School Diaries
Toto's and Annoula's class has decided to sell their school's calendars in order to raise money for a school trip.
The kids came with the idea to visit all the buildings of some of the biggest streets in Athens, in order, since there are a lot of stores there.
To finish their goal faster, they decided that the boys would enter buildings with an odd number on their address, on a particular street, while the girls would enter the ones with an even number on their address.
We would like to write a program that reads from the input STDIN
positive integers, seperated by a line change character ('\n'
).
The first number will be either 0
, to indicate the girl's team, or 1
to indicate the boy's team.
The second number indicates the adress number of the starting building, where the kids begin their sales, on a particular street.
The third number indicates the adress number of the final building, where the kids finish their sales journey, at that particular street.
Each street has at most buildings, where .
The program will print in the output STDOUT
all the address numbers that the girls or boys will visit (this will be decided by the program based on the first number in the input, i.e. 0
or 1
), separated by a line break character ('\n
).
Note:
- If the second number in the input, which indicates the address number of the building from which the children start selling the calendars, is smaller than the third number in the input, which indicates the address number of the building in which the children finish selling the calendars, then the even or odd numbers are printed in the output, respectively, starting with the smallest and ending with the largest.
- If the second number in the input, which indicates the number of the address of the building from which the children start selling the diaries, is larger than the third number in the input, indicating the number of the address of the building in which the children finish selling the diaries, then the even or odd numbers are printed in the output, starting with the largest and ending with the smallest.
Examples
1st
STDIN
1
2
23
STDOUT
3
5
7
9
11
13
15
17
19
21
23
Επεξήγηση του 1ου παραδείγματος:
In the first line, the number indicates that we are considering the boys' group, and so we should print the odd numbers of the street addresses that the boys' group went through to sell calendars.
The following are the lines of code that include the odd numbers of street addresses that the boys' group passed by.
2nd
STDIN
0
10
2
STDOUT
10
8
6
4
2
Επεξήγηση του 2ου παραδείγματος:
On the first line, the number indicates that we are concidering the girls' group, and so we should print the even numbers of the street addresses that the girls' group went through to sell calendars.
The following are the lines of code that include the even numbers of the street addresses that the group of girls passed by.
Comments