제출 #521437

#제출 시각아이디문제언어결과실행 시간메모리
521437Rasoul006Košnja (COCI17_kosnja)C++17
50 / 50
13 ms1212 KiB
#include <bits/stdc++.h>

#define endl "\n"

typedef long long ll;

using namespace std;

const int N = 1e6+5;

ll t , n , m ;
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> t ;
    while(t--){
        cin >> n >> m ;
        ll ans =  0;
        if(n <= m){
            ans = 2 * (n - 1) ;
        }
        else{
            ans = 2 * (m - 1) ;
        }
        cout << ans << endl;
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...