Wrong Answer
Code
/*
* Copyright (c) 2024 Emon Thakur
* All rights reserved.
*/
#include<bits/stdc++.h>
using namespace std;
//ofstream file("output9.txt");
void solve()
{
int A,B,C; cin>>A>>B>>C;
int a,b,c,sum=A+B+C;
a = min({A,B,C});
c = max({A,B,C});
b = sum-a-c;
int k = __gcd(b-a,c-b);
//cout<<(c-a)/k<<endl;
if(k==0) cout<<0<<endl;
else cout<<(c-a)/k<<endl;
}
int main()
{
//freopen("input9.txt","r",stdin);
int t; cin>>t; while(t--) solve();
}
Information
- Submit By
- Type
- Submission
- Problem
- P1061 Bring equality
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-05-22 09:51:36
- Judged At
- 2024-05-22 09:51:36
- Judged By
- Score
- 90
- Total Time
- 24ms
- Peak Memory
- 820.0 KiB