Donat un natural nn pel canal d’entrada, feu un programa que escrigui per la sortida estàndard la següent seqüència (de mida nn):
1,n,2,n−1,3,n−2,4,n−3,…1, n, 2, n-1, 3, n-2, 4, n-3, \dots
Un natural nn.
La seqüència:
de mida nn.
The official statement of a problem is always the one in the PDF document. The HTML version of the statement is also given to help you, but may contain some content that is not well displayed. In case of doubt, always use the PDF.
Input
4
Output
1 4 2 3
5
1 5 2 4 3