UVa 133 The Dole Queue(救济金发放)
- 题目名称:救济金发放
- 题目描述:
- n(n < 20)个人站成一圈,逆时针编号为1~n,有两个官员,A从1开始逆时针数,B从n开始顺时针数,在每一轮中,官员A数k个就停下来,官员B数m个就停下来
- (注意有可能两个官员停在同一个人身上)。接下来被官员选中的人(1个或者两个)离开队伍
- 输入n,k,m输出每轮里被选中的人的编号,如果有两个人,先输出被A选中的,
- 例如,n = 10;k = 4; m = 3 输出为4 8,9 5,3 1,2 6,10,7。 输出的每个数应当恰好占3列
- 题目分析: