/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 1ms 324.0 KiB
#2 Wrong Answer 1ms 320.0 KiB

Code

#include <iostream>
#include <cmath>
using namespace std;
int main() {
    
    //SAYED AL MAMUN_LU
    
    int t;
    cin >> t;

    while (t--) {
        int a, b, sum = 0;
        cin >> a >> b;

        while (a > 0 && b > 0) {
            if (a > b) {
                a = abs(a - b);
                sum++;
            } 
            else {
                b = abs(b - a);
                sum++;
            }
            
        }

        cout << sum << endl;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1026 LUFA cup 2024
Contest
Brain booster #2
Language
C++17 (G++ 13.2.0)
Submit At
2024-03-06 16:52:48
Judged At
2024-11-11 03:41:10
Judged By
Score
0
Total Time
1ms
Peak Memory
324.0 KiB