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

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

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

      Educational Codeforces Round 76 (Rated for Div. 2) B. Magic Stick 水題

      B. Magic Stick

      Recently Petya walked in the forest and found a magic stick.

      Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:

      If the chosen number ?? is even, then the spell will turn it into 3??2;
      If the chosen number ?? is greater than one, then the spell will turn it into ???1.
      Note that if the number is even and greater than one, then Petya can choose which spell to apply.

      Petya now has only one number ??. He wants to know if his favorite number ?? can be obtained from ?? using the spells he knows. The spells can be used any number of times in any order. It is not required to use spells, Petya can leave ?? as it is.

      Input

      The first line contains single integer ?? (1≤??≤104) — the number of test cases. Each test case consists of two lines.

      The first line of each test case contains two integers ?? and ?? (1≤??,??≤109) — the current number and the number that Petya wants to get.

      Output

      For the ??-th test case print the answer on it — YES if Petya can get the number ?? from the number ?? using known spells, 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
      7
      2 3
      1 1
      3 6
      6 8
      1 2
      4 1
      31235 6578234
      output
      YES
      YES
      NO
      YES
      NO
      YES
      YES

      題意

      現在給你一個數x。
      如果這個數是偶數,你可以讓這個數變成x/2*3。
      你也可以讓這個數變成x-1

      問你x經過若干次變換之后,能否變成y,能輸出YES,不能輸出NO

      題解

      其實,當x大于等于4的時候,這個x就可以變成無限大了,然后讓x不斷減1,就可以得到y了。
      其他情況我們暴力就可以。

      代碼

      #include<bits/stdc++.h>
      using namespace std;
      
      void solve(){
      	long long x,y;
      	map<long long,int>H;
      	cin>>x>>y;
      	while(H[x]==0){
      		if(x>=y){
      			cout<<"YES"<<endl;
      			return;
      		}
      		H[x]=1;
      		if(x%2==1)x--;
      		x=x/2*3;
      	}
      	cout<<"NO"<<endl;
      }
      int main(){
      	int t;
      	scanf("%d",&t);
      	while(t--)solve();
      }
      
      posted @ 2019-11-14 17:52  qscqesze  閱讀(458)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 欧美精品videosbestsex日本 | 亚洲av在线观看| 砀山县| 亚洲成片在线看一区二区| 极品粉嫩小泬无遮挡20p| 国产情侣激情在线对白| 国产成人啪精品午夜网站| 欧美综合自拍亚洲综合图| 成人国产精品中文字幕| 白嫩人妻精品一二三四区| 97精品人妻系列无码人妻| 蜜桃久久精品成人无码av| 亚洲特黄色片一区二区三区| 国产精品亚洲综合色区丝瓜| 国产怡春院无码一区二区| 亚洲中文字幕有综合久久| 国产精品自在欧美一区| 人妻系列无码专区免费| 亚洲美女少妇偷拍萌白酱| 久久精品国产99久久六动漫| 亚洲欧美综合中文| 亚洲区一区二区激情文学| 欧美三级不卡在线观线看高清| 亚洲日本韩国欧美云霸高清| 极品美女自拍偷精品视频| 9丨精品国产高清自在线看| 国产成人精品1024免费下载| 久久国内精品一区二区三区| 欧美videos粗暴| av老司机亚洲精品天堂| 狠狠综合久久综合88亚洲| 好吊妞视频这里有精品| 久久夜色精品国产亚洲a| 成人年无码av片在线观看| 长腿校花无力呻吟娇喘的视频| 四虎成人精品永久免费av| 亚洲成AV人片在线观高清| 她也色tayese在线视频| 国产无人区码一区二区| 江门市| 色国产视频|