国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
泗洪县| 江西省| 新乡县| 汉中市| 汉寿县| 高台县| 万宁市| 苏尼特左旗| 临泉县| 斗六市| 高尔夫| 霞浦县| 新乡县| 铁岭县| 奉贤区| 台北市| 子长县| 博爱县| 常德市| 商都县| 萨嘎县| 辉县市| 商南县| 澄迈县| 蒙自县| 茂名市| 临泉县| 安达市| 大姚县| 长垣县| 宝清县| 锡林郭勒盟| 永康市| 鹤庆县| 石棉县| 台南市| 白水县| 灌南县| 夏河县| 平度市| 泾阳县|