#include<bits/stdc++.h>
using namespace std;
#define int long long
int x,y;
void solve(){
scanf("%lld%lld",&x,&y);
if(x==y) printf("%lld\n",x);
else if(x>y) printf("%lld\n",x+y);
else printf("%lld\n",y-(y%x)/2);
}
signed main(){
int t=1;
scanf("%lld",&t);
while(t--) solve();
return 0;
}
1500*B. Moderate Modular Mode(构造&规律)
最新推荐文章于 2024-09-04 21:39:45 发布