Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Solutions/16priyesh/1_16priyesh.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
//coded by 16priyesh
#include <bits/stdc++.h>
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

int main(){
//To reduce the runtime
FAST;
int t;
cin>>t;
while(t--){
int x,y,p;
cin>>x>>y>>p;
if(p%2!=0) x*=2;
//Check odd bitwise.
if(p&1) x*=2;
int result=(x>y)?(x/y):(y/x);
cout<<result<<endl;
}
Expand Down