无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

CF 1814A - Coins

2023-07-20 15:12 作者:您是打尖兒還是住店呢  | 我要投稿

In Berland, there are two types of coins, having denominations of 2 and k burles.

Your task is to determine whether it is possible to represent n burles in coins, i.?e. whether there exist non-negative integers x and y such that 2?x+k?y=n.

Input

The first line contains a single integer t (1≤t≤104) — the number of test cases.

The only line of each test case contains two integers n and k (1≤k≤n≤1018; k≠2).

Output

For each test case, print YES if it is possible to represent n burles in coins; otherwise, print NO. You may print each letter in any case(YES, yes, Yes will all be recognized as positive answer, NO, no and nO will all be recognized as negative answer).

-------------------------------------------

在貝爾蘭,有兩種硬幣,面值分別為 2 伯勒和 k 伯勒。

你的任務(wù)是確定是否可以用硬幣 i 來表示 n 個(gè) burles。 e. 是否存在非負(fù)整數(shù) x 和 y 使得 2?x+k?y=n。

輸入

第一行包含一個(gè)整數(shù) t (1≤t≤104) — 測試用例的數(shù)量。

每個(gè)測試用例的唯一行包含兩個(gè)整數(shù)n和k(1≤k≤n≤1018;k≠2)。

輸出

對于每個(gè)測試用例,如果可以用硬幣表示n個(gè)burles,則打印YES; 否則,打印NO。 您可以在任何情況下打印每個(gè)字母(YES、yes、Yes 都將被識別為肯定答案,NO、no 和 nO 都將被識別為否定答案)。

----------------------------------------------

發(fā)現(xiàn)了,我就只能做做AB類的題目,C的都差很多,遙遙無期的刷題路啊。。。。

這里面只有k是偶數(shù),n為奇數(shù)的時(shí)候才組成不了,其他都可以。


CF 1814A - Coins的評論 (共 條)

分享到微博請遵守國家法律
邵阳市| 名山县| 抚顺市| 陇川县| 苏尼特左旗| 道孚县| 怀化市| 鄄城县| 呼玛县| 屯留县| 扶余县| 建平县| 高清| 周至县| 益阳市| 景德镇市| 鄂伦春自治旗| 巨鹿县| 榕江县| 闽侯县| 教育| 阳东县| 新巴尔虎右旗| 南乐县| 平遥县| 余庆县| 白山市| 凭祥市| 巴林左旗| 安岳县| 固安县| 防城港市| 舒城县| 咸阳市| 牙克石市| 潜山县| 田东县| 彰化县| 铁岭市| 黄梅县| 宜君县|