Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 1_16priyesh.cpp #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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