<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Codeforces Round #598 (Div. 3) A. Payment Without Change 水題

      A. Payment Without Change

      You have a coins of value n and b coins of value 1. You always pay in exact change, so you want to know if there exist such x and y that if you take x (0≤x≤a) coins of value n and y (0≤y≤b) coins of value 1, then the total value of taken coins will be S.

      You have to answer q independent test cases.

      Input

      The first line of the input contains one integer q (1≤q≤104) — the number of test cases. Then q test cases follow.

      The only line of the test case contains four integers a, b, n and S (1≤a,b,n,S≤109) — the number of coins of value n, the number of coins of value 1, the value n and the required total value.

      Output

      For the i-th test case print the answer on it — YES (without quotes) if there exist such x and y that if you take x coins of value n and y coins of value 1, then the total value of taken coins will be S, and NO otherwise.

      You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).

      Example

      input
      4
      1 2 3 4
      1 2 3 6
      5 2 6 27
      3 3 5 18
      output
      YES
      NO
      NO
      YES

      題意

      你有a個價值為n的硬幣,你有b個價值為1的硬幣,問你能否組成S塊錢。

      題解

      貪心,能用a就用a對吧

      代碼

      #include<bits/stdc++.h>
      using namespace std;
      
      void solve(){
      	long long a,b,n,s;
      	cin>>a>>b>>n>>s;
      	long long d = s/n;
      	d=min(d,a);
      	if(b>=s-d*n){
      		cout<<"YES"<<endl;
      	}else{
      		cout<<"NO"<<endl;
      	}
      }
      int main(){
      	int t;
      	scanf("%d",&t);
      	while(t--)solve();
      }
      
      posted @ 2019-11-05 15:36  qscqesze  閱讀(451)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 中文字幕无线码中文字幕免费| 日本无遮挡真人祼交视频| 亚洲毛片多多影院| 亚洲欧美综合人成在线| 狠狠色丁香婷婷久久综合五月| 蜜桃av亚洲精品一区二区| 日韩成人福利视频在线观看| 亚洲天堂视频网| 秋霞电影院午夜无码免费视频| 亚洲欧美综合人成在线| 成人免费亚洲av在线| 国产果冻豆传媒麻婆精东| 久久精产国品一二三产品| 国产亚洲精品日韩av在| 一本色道久久88亚洲综合| 国产无人区码一区二区| 蜜臀av黑人亚洲精品| 免费人成网站免费看视频| 内射少妇一区27p| 性色av一区二区三区v视界影院| 蜜芽久久人人超碰爱香蕉| 婷婷五月综合丁香在线| 亚洲国产综合一区二区精品| 日本大片在线看黄a∨免费| 污网站在线观看视频| 久久99精品久久久学生| 亚洲精品美女久久久久9999| 亚洲男人电影天堂无码| 亚洲国产日韩在线视频| 永久免费无码av在线网站| 国产精品系列在线免费看| 久久人爽人人爽人人片av| 国产精品一二三区蜜臀av| 黑人巨大av无码专区| 免费无码一区无码东京热| 国产超碰无码最新上传| 金川县| 亚洲国产午夜精品理论片| 午夜激情福利一区二区| 亚洲中文无码永久免费| 国产成人高清亚洲综合|