#include #include #include int main() { int a, b; std::cin >> a >> b; if (a > b) { std::swap(a, b); } int min = a + b; for (int i = 0; i <= a; i++) { min = std::min(min, abs(4 * i - (a + b))); } std::cout << min << '\n'; }