Difficulty:
Cakewalk
Prerequisite:
Basic math, operator precedence, data types.
Hint:
Make sure you use the correct order for the mathematical operations otherwise you will get wrong answers.
Explanation:
For every budget N, check if N >= K+(20*K)/100.
Setter’s Solution:
#include <bits/stdc++.h> using namespace std;
int main(){
int T;
cin>>T;
while(T--){
int N,K;
cin>>N>>K;
if(N>=(K+(20*K)/100))
cout<<"TRUE"<<"\n";
else
cout<<"FALSE"<<"\n";
}
return 0;
}
Time Complexity:
O(1) for each test case.
Space Complexity:
O(1) for each test case.
Alternate Solution:
None
Python Implementation:
for t in range(int(input())):
n,k = map(int,input().split())
if n >= (k + k//5):
print("TRUE")
else:
print("FALSE")