Submission #161483

#TimeUsernameProblemLanguageResultExecution timeMemory
161483ToniBKošnja (COCI17_kosnja)C++14
50 / 50
179 ms1016 KiB
#include <iostream> using namespace std; int main(){ int k, m, n; cin >> k; int sol[k]; for(int i = 0; i < k; i++){ cin >> m >> n; if(m == 1 or n == 1){ sol[i] = 0; } else if(m < n){ sol[i] = (m-1)*2; } else{ sol[i] = (n-1)*2; } } for(int i = 0; i < k; i++){ cout << sol[i] << endl; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...