Pro.ID22169 TitleTurn on the lights Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22169 AC0 Submit0 Ratio- 时间&空间限制描述You are given a regular polygon of size n, and n is a positive odd number. At each vertex there is a light. Initially, all the lights are off. Now you want to turn all the lights on. When you push the button of one light, the light itself and the two lights which are opposite to it will change states(from on to off or from off to on). For example, n is 7, and the vertexes are numbered from 1 to 7. Then if you push the button of light 1, lights 1, 4, 5 will change states. In another case, you push the button of light 4, light 4, 1, 7 will change states. Now given n, please tell me the minimum times of pushing the buttons in order to turn all the lights on. 输入For each test case, the input contains a single integer n. 3 ≤ n ≤ 1000, and n is odd. 输出Description You are given a regular polygon of size n, and n is a positive odd number. At each vertex there is a light. Initially, all the lights are off. Now you want to turn all the lights on. When you push the button of one light, the light itself and the two lights which are opposite to it will change states(from on to off or from off to on). For example, n is 7, and the vertexes are numbered from 1 to 7. Then if you push the button of light 1, lights 1, 4, 5 will change states. In another case, you push the button of light 4, light 4, 1, 7 will change states. Now given n, please tell me the minimum times of pushing the buttons in order to turn all the lights on. Input For each test case, the input contains a single integer n. 3 ≤ n ≤ 1000, and n is odd. Output For each test case, output the answer in a single line. Sample Input 5 Sample Output 5 Source 样例输入5 样例输出5 作者 |