jakaria_hossain

codeforce - nastya and rice

May 4th, 2020
1,699
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL))
  5. int main(){
  6.     fast();
  7.     ll t;
  8.     cin>>t;
  9.     while(t--)
  10.     {
  11.         ll n, a,b,c,d,i;
  12.         cin>>n>>a>>b>>c>>d;
  13.  
  14.         if((c+d)<n*(a-b))cout<<"No"<<endl;
  15.          else if  ((c-d)>n*(a+b))cout<<"No"<<endl;
  16.         else cout<<"Yes"<<endl;
  17.  
  18.     }
  19. }
RAW Paste Data