A871.Ball Game

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

A kindergarten teacher Natalia Pavlovna has invented a new ball game. This game not only develops the children's physique, but also teaches them how to count.

The game goes as follows. Kids stand in circle. Let's agree to think of the children as numbered with numbers from 11 to nn clockwise and the child number 11 is holding the ball. First the first child throws the ball to the next one clockwise, i.e. to the child number 22 . Then the child number 22 throws the ball to the next but one child, i.e. to the child number 44 , then the fourth child throws the ball to the child that stands two children away from him, i.e. to the child number 77 , then the ball is thrown to the child who stands 33 children away from the child number 77 , then the ball is thrown to the child who stands 44 children away from the last one, and so on. It should be mentioned that when a ball is thrown it may pass the beginning of the circle. For example, if n=5n=5 , then after the third throw the child number 22 has the ball again. Overall, n1n-1 throws are made, and the game ends.

The problem is that not all the children get the ball during the game. If a child doesn't get the ball, he gets very upset and cries until Natalia Pavlovna gives him a candy. That's why Natalia Pavlovna asks you to help her to identify the numbers of the children who will get the ball after each throw.

输入格式

The first line contains integer nn ( 2<=n<=1002<=n<=100 ) which indicates the number of kids in the circle.

输出格式

In the single line print n1n-1 numbers which are the numbers of children who will get the ball after each throw. Separate the numbers by spaces.

输入输出样例

  • 输入#1

    10
    

    输出#1

    2 4 7 1 6 2 9 7 6
    
  • 输入#2

    3
    

    输出#2

    2 1
    
首页