Summer Camp (4) Fifth ——— number theory (hdu1222)

Source: Internet
Author: User

Test instructions Summary: After that day, you persuasion, are fast into three inch not rotten of the occasion, small a
At least not in the face of the dead, the fish eyes are bulging. There was a sign of a point of recovery. But Mencius, this guy.
The words still have some reason, that day will drop .... Well, in short, as Sage's law was not finished
into, and small A and slow to appear, FFF Regiment head even under seven flame orders to kill you, the first to rush
To the ground, mechanized troops, they can be said to be impeccable except for their intelligence.
This is exactly what you have to take advantage of, using their trajectory of action to hide.

Problem Analysis: First use the method of GCD (n,m), if N>m gcd (n,m) for a can escape
Conversely, not one can escape .

1#include"Cstdio"2 3 intMain ()4 {5     intm,n,t,x;6scanf ("%d",&t);7      while(t--&& scanf ("%d%d",&n,&m))8     {9          while(n% m! =0)Ten         { Onex =m; Am = n%m; -n =x; -         } the         if(N >=m) -printf ("%s\n", m==1?"NO":"YES"); -         Else -printf ("%s\n", m==1?"YES":"NO"); +     } -     return 0; +}
View Code

Summer Camp (4) Fifth ——— number theory (hdu1222)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.