mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 18:31:59 +00:00
D - Moderate Modular Mode
https://codeforces.com/contest/1604/submission/133681028
This commit is contained in:
parent
e80a522771
commit
cdfdce21da
20
CodeForces/1604/D/D.cpp
Normal file
20
CodeForces/1604/D/D.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user