#include <stdio.h>
int getInt()
{
char ch;
int n = 0;
while( ch = getchar())
if(ch != ' ' && ch != '\n') break;
n = ch - 48;
while( ch = getchar())
{
if(ch == ' ' || ch == '\n') break;
n = n * 10 + ch - 48;
}
return n;
}
int main()
{
int i, caseNum, N, K, P, j;
caseNum = getInt();
for (i = 1; i <= caseNum; i ++)
{
N = getInt(), K = getInt(), P = getInt();
j = (K + P) % N;
if (j == 0) j = N;
printf("Case %d: %d\n", i, j);
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言