Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.053 s | 14 KBi |
#2 |
Correcto
|
0.081 s | 10 KBi |
#3 |
Correcto
|
0.092 s | 10 KBi |
#4 |
Incorrecto
|
0.053 s | 14 KBi |
#5 |
Correcto
|
0.042 s | 13 KBi |
#6 |
Correcto
|
0.051 s | 13 KBi |
#7 |
Correcto
|
0.044 s | 14 KBi |
#8 |
Correcto
|
0.043 s | 14 KBi |
#9 |
Correcto
|
0.087 s | 36 KBi |
#10 |
Correcto
|
0.079 s | 18 KBi |
#11 |
Correcto
|
0.081 s | 10 KBi |
#12 |
Correcto
|
0.081 s | 10 KBi |
#13 |
Correcto
|
0.052 s | 13 KBi |
#14 |
Correcto
|
0.08 s | 10 KBi |
#15 |
Correcto
|
0.08 s | 10 KBi |
#16 |
Correcto
|
0.051 s | 13 KBi |
#17 |
Correcto
|
0.098 s | 10 KBi |
#18 |
Correcto
|
0.043 s | 13 KBi |
#19 |
Incorrecto
|
0.093 s | 10 KBi |
#20 |
Correcto
|
0.044 s | 14 KBi |
#21 |
Correcto
|
0.053 s | 13 KBi |
#22 |
Correcto
|
0.052 s | 14 KBi |
#23 |
Correcto
|
0.089 s | 30 KBi |
#24 |
Correcto
|
0.052 s | 14 KBi |
#25 |
Correcto
|
0.082 s | 10 KBi |
#26 |
Incorrecto
|
0.051 s | 13 KBi |
#27 |
Correcto
|
0.053 s | 14 KBi |
#28 |
Correcto
|
0.08 s | 10 KBi |
#29 |
Incorrecto
|
0.082 s | 10 KBi |
#30 |
Incorrecto
|
0.045 s | 14 KBi |
#31 |
Correcto
|
0.05 s | 14 KBi |
#32 |
Correcto
|
0.053 s | 13 KBi |
#33 |
Incorrecto
|
0.096 s | 14 KBi |
#34 |
Correcto
|
0.072 s | 20 KBi |
#35 |
Correcto
|
0.053 s | 14 KBi |
#36 |
Correcto
|
0.056 s | 14 KBi |
import java.io.*; import java.util.StringTokenizer; class Main { public static void main(String[] args) throws IOException{ BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; st = new StringTokenizer(bf.readLine()); long cantidad = Integer.parseInt(st.nextToken()); long x = Integer.parseInt(st.nextToken()); long y = Integer.parseInt(st.nextToken()); long diferencia = Math.abs(y-x); if(x>y){ if(cantidad/2<Math.abs(x-y)){ System.out.println(Math.abs(cantidad-x)); }else{ System.out.println(Math.abs(x-y)); } }else{ if(cantidad/2<Math.abs(x-y)){ System.out.println(diferencia-1); }else{ System.out.println(diferencia); } } } }