/* -*- coding: utf-8 -*- * * 2239.cc: No.2239 Friday - yukicoder */ #include #include using namespace std; /* constant */ /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int a, b; scanf("%d%d", &a, &b); int mind = a + b, c = min(a, b); for (int x = 0; x <= c; x++) { int u = x * 2, v = (a + b) - u; mind = min(mind, abs(u - v)); } printf("%d\n", mind); return 0; }