Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL))
- int main(){
- fast();
- ll t;
- cin>>t;
- while(t--)
- {
- ll n, a,b,c,d,i;
- cin>>n>>a>>b>>c>>d;
- if((c+d)<n*(a-b))cout<<"No"<<endl;
- else if ((c-d)>n*(a+b))cout<<"No"<<endl;
- else cout<<"Yes"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment