asm("mark\soutchar;outchar;push\s0;return"); asm("mark\soutnum;outnum;push\s0;return"); asm("mark\sreadchar;push\s0;dup;readchar;retrieve;return"); asm("mark\sreadnum;push\s0;dup;readnum;retrieve;return"); asm("mark\snextInt;push\s0;mark\snextIntloop;push\s0;dup;readchar;retrieve;push\s48;sub;dup;jneg\snextIntend;dup;push\s9;swap;sub;jneg\snextIntend;swap;push\s10;mul;add;jump\snextIntloop;mark\snextIntend;disc;return"); def main() { var a = nextInt(); var b = nextInt(); var s = nextInt(); outnum(solve(a,b,s)); outchar('\n'); } def solve(a,b,s) { var la = abs(a-s); var lb = abs(b-s); var ans = 0; if (a == 0) { if (la <= lb) { return la + s; }else{ return lb + s + 1; } }else{ if (la <= lb) { return la + s; }else{ return lb + s; } } } def abs(n) { if (n < 0) { return -n; } return n; } -