Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.083 s | 15 KBi |
#2 |
Correcto
|
0.087 s | 15 KBi |
#3 |
Correcto
|
0.091 s | 15 KBi |
#4 |
Correcto
|
0.085 s | 15 KBi |
#5 |
Correcto
|
0.086 s | 15 KBi |
#6 |
Correcto
|
0.09 s | 15 KBi |
#7 |
Correcto
|
0.083 s | 15 KBi |
#8 |
Correcto
|
0.081 s | 16 KBi |
#9 |
Correcto
|
0.083 s | 15 KBi |
#10 |
Correcto
|
0.089 s | 15 KBi |
#11 |
Correcto
|
0.083 s | 15 KBi |
#12 |
Correcto
|
0.091 s | 15 KBi |
#13 |
Correcto
|
0.09 s | 15 KBi |
#14 |
Correcto
|
0.093 s | 15 KBi |
#15 |
Correcto
|
0.079 s | 15 KBi |
#16 |
Correcto
|
0.072 s | 15 KBi |
#17 |
Correcto
|
0.091 s | 15 KBi |
#18 |
Correcto
|
0.087 s | 15 KBi |
#19 |
Correcto
|
0.086 s | 15 KBi |
#20 |
Correcto
|
0.088 s | 15 KBi |
#21 |
Correcto
|
0.086 s | 15 KBi |
#22 |
Correcto
|
0.085 s | 15 KBi |
#23 |
Correcto
|
0.094 s | 15 KBi |
#24 |
Correcto
|
0.082 s | 15 KBi |
#25 |
Correcto
|
0.09 s | 15 KBi |
#26 |
Correcto
|
0.082 s | 15 KBi |
#27 |
Correcto
|
0.081 s | 15 KBi |
#28 |
Correcto
|
0.088 s | 16 KBi |
#29 |
Correcto
|
0.078 s | 15 KBi |
#30 |
Correcto
|
0.086 s | 15 KBi |
#31 |
Correcto
|
0.091 s | 16 KBi |
#32 |
Correcto
|
0.084 s | 15 KBi |
#33 |
Correcto
|
0.09 s | 15 KBi |
#34 |
Correcto
|
0.087 s | 15 KBi |
#35 |
Correcto
|
0.087 s | 15 KBi |
#36 |
Correcto
|
0.093 s | 15 KBi |
import java.util.*; class Main { public static void main(String [] args){ Scanner scanner = new Scanner(System.in); Integer N = scanner.nextInt(); int X = scanner.nextInt(); int Y = scanner.nextInt(); int izquierdo; int derecho; if(Y >= X){ izquierdo = Y - X; derecho = X + (N - Y); } else { izquierdo = (N - X) + Y; derecho = X - Y; } System.out.println(Math.min(izquierdo,derecho)); } }