五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

分享到微博請遵守國家法律
张掖市| 阿勒泰市| 儋州市| 子长县| 满洲里市| 大埔区| 定远县| 科尔| 顺平县| 灵石县| 河南省| 信丰县| 西畴县| 革吉县| 扶风县| 西吉县| 莎车县| 石河子市| 循化| 丹凤县| 贺兰县| 炎陵县| 桃源县| 焦作市| 天长市| 岢岚县| 临桂县| 临沂市| 锡林郭勒盟| 大姚县| 泰宁县| 梓潼县| 乌苏市| 云林县| 灌南县| 岑溪市| 江阴市| 石柱| 陵水| 布拖县| 噶尔县|