My issue
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t–){
int a,b,c,d;
cin>>a>>b>>c>>d;
int p;
if(d<0){
p=a - d0.01a;
}
else{
p=a + d0.01a;
}
if(p>=b &&p<=c){
cout<<“Yes”<<endl;
}
else cout<<“No”<<endl;
}
}
what is wrong with this ?
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin>>t;
while(t--){
int a,b,c,d;
cin>>a>>b>>c>>d;
int p;
if(d<0){
p=a - d*0.01*a;
}
else{
p=a + d*0.01*a;
}
if(p>=b &&p<=c){
cout<<"Yes"<<endl;
}
else cout<<"No"<<endl;
}
}
Learning course: Level up from 1* to 2*
Problem Link: Chef and Stock Prices Practice Problem in Level up from 1* to 2* - CodeChef