diff --git a/CodeForces/1604/D/D.cpp b/CodeForces/1604/D/D.cpp new file mode 100644 index 00000000..b923b101 --- /dev/null +++ b/CodeForces/1604/D/D.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int t, x, y; + +int main() { + cin >> t; + while (t--) { + cin >> x >> y; + if (x > y) { + cout << x + y << endl; + } else if (x == y) { + cout << x << endl; + } else { + cout << y - (y % x / 2) << endl; + } + } + return 0; +}