491A.md (1549B)
1 Source: https://codeforces.com/problemset/problem/491/A 2 3 A. Up the hill 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 Hiking club "Up the hill" just returned from a walk. Now they are trying to remember which hills they've just walked through. 22 23 It is known that there were *N* stops, all on different integer heights between 1 and *N* kilometers (inclusive) above the sea level. On the first day they've traveled from the first stop to the second stop, on the second day they've traveled from the second to the third and so on, and on the last day they've traveled from the stop *N* - 1 to the stop *N* and successfully finished their expedition. 24 25 They are trying to find out which heights were their stops located at. They have an entry in a travel journal specifying how many days did they travel up the hill, and how many days did they walk down the hill. 26 27 Help them by suggesting some possible stop heights satisfying numbers from the travel journal. 28 29 Input 30 31 In the first line there is an integer non-negative number *A* denoting the number of days of climbing up the hill. Second line contains an integer non-negative number *B* — the number of days of walking down the hill (*A* + *B* + 1 = *N*, 1 ≤ *N* ≤ 100 000). 32 33 Output 34 35 Output *N* space-separated distinct integers from 1 to *N* inclusive, denoting possible heights of the stops in order of visiting. 36 37 Examples 38 39 Input 40 41 ``` 42 0 43 1 44 ``` 45 46 Output 47 48 ``` 49 2 1 50 ``` 51 52 Input 53 54 ``` 55 2 56 1 57 ``` 58 59 Output 60 61 ``` 62 1 3 4 2 63 ```