Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
报数
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 186, Accepted users: 176
Problem 10491 : No special judgement
Problem description
  幼儿园老师组织小朋友进行游戏,13个人围成一圈,从第1个人开始顺序报号123。凡报到“3”者退出圈子。请你帮小朋友找出最后留在圈子的人原来的序号。我们这里假设报数的人数为N(1<=N<=200)

Input
  第一行,一个整数T(1<=T<=100),表示共有多少组测试数据。接着下面的T行数据为T组报数的人数N(1<=N<=200)

Output
  对每组测试数据,第一行输出小朋友离开的次序,第二行输出最后留在圈子的人原来的序号。

Sample Input
2
3
5
Sample Output
Sequence that persons leave the circle:
3 1 
The last one is:2
Sequence that persons leave the circle:
3 1 5 2 
The last one is:4
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2182 today,16258909 total, since 2010-05-07