UVa 11388 & Silk Silks

Source: Internet
Author: User

have been thinking of silk to do not paste the question ... Later I think it is affixed to the bar ... Anyway, no one read ... blog is open to their own look ... Occasionally bored to play blog also seems to live very full ...

Test instructions

For a gcd and LCM to satisfy ah their smallest A and B.

SOL:

And thinking about the decomposition of the mass factor ... On the other GCD small number of GCD also can not become G ah ... This is not silk ... The youngest is not the gcd ...

Number theory begins with a few silk problems = = ...

  

Code:

    #include <cstdio>      #include <cstdlib>      #include <cstring>            int main ()      {          int n,g, L;           while (scanf ("%d", &n)! = EOF) for               (int t = 1; t <= N; + + t) {                  scanf ("%d%d", &g,&l);                  if (l%g = = 0)                       printf ("%d%d\n", g,l);                  else printf (" -1\n");              }          return 0;      }  

UVa 11388 & Silk Silks

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: info-contact@alibabacloud.com 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.