Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<bits/stdc++.h>
- #include<utility>
- #define ll long long
- #define ull unsigned long long
- #define pi 3.14159
- #define OO 2000000000
- //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
- using namespace std;
- void yasmeen_fakhri(){
- ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
- #ifndef ONLINE_JUDGE
- freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
- #endif
- }
- void solve(){
- ll a,b ;
- cin>>a>>b;
- double at = a/(0.08);
- double bt = b/(0.1);
- if (at == bt ) cout<<at<<"\n";
- else {
- ll af1 =at*(0.08);
- ll af2 =at*(0.1);
- ll bf1 =bt*(0.08);
- ll bf2 =bt*(0.1);
- if (af1 == af2 ) cout<<at<<"\n";
- else if (bf1 == bf2 ) cout<<bt<<"\n";
- else cout<<-1<<"\n";
- }
- }
- int main() {
- yasmeen_fakhri();
- int test =1;
- cin>>test;
- while(test--){
- solve();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement