#K4566. Full-Sized Worker Ants Calculation

    ID: 27803 Type: Default 1000ms 256MiB

Full-Sized Worker Ants Calculation

Full-Sized Worker Ants Calculation

In this problem, you are required to calculate the number of full-sized worker ants present in an ant colony at a series of given observation times. The colony develops such that at any minute ( t ), the number of full-sized worker ants is given by ( \max(0, t-1) ).

For example, if you observe the colony at minutes 1, 3, and 5, then the respective counts would be ( \max(0, 1-1)=0 ), ( \max(0, 3-1)=2 ), and ( \max(0, 5-1)=4 ).

inputFormat

The input is given in the following format via standard input (stdin):

( m) ( p)
( a_1 \ a_2 \ \dots \ a_p )

Where:
- ( m ) is an integer representing the total duration of the study in minutes (although it is not directly used in the calculation).
- ( p ) is the number of observation points.
- ( a_1, a_2, \dots, a_p ) are the observation times at which you need to report the number of full-sized worker ants.

outputFormat

Output a single line to the standard output (stdout) containing ( p ) integers, where the ( i^{th} ) integer is the number of full-sized worker ants present at observation time ( a_i ). The values should be separated by spaces.## sample

5 3
1 3 5
0 2 4