codeforces346 Div.2 A.Round House

时间:2023-03-09 15:44:45
codeforces346 Div.2 A.Round House

课间水一水,CCF备战

 package com.company.cf346;

 import java.io.InputStreamReader;
import java.util.Scanner; /**
* Created by Admin on 2016/4/5.
*/
public class a {
public static void main(String[] args){
Scanner sc = new Scanner(new InputStreamReader(System.in));
int n, a, b;
n = sc.nextInt();
a = sc.nextInt();
b = sc.nextInt();
int ans = 0;
if(b < 0){
while(b < 0){
b = b + n;
}
b = b % n;
ans = (a + b) % n;
}else {
ans = (a + b) % n;
}
if(ans == 0)
ans = n;
System.out.println(ans);
}
}