ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1355. Bald Spot Revisited

Igor test2 [2] // Problem 1355. Bald Spot Revisited 30 Aug 2005 14:03
#include <iostream>
using namespace std;
 long long  a,b,t,c,d,k,s,f;

int main ()
{
    c = 1; k = 0;
   cin >>t;
   for (t;t>=1;--t) {
     cin >>a;
      cin >>b;
   if ( b%a==0)
   {
       for( ; d != b; ++c )
       {
         d = a*c;
          if ( b % d == 0)
          {
              k= k+1;
              a = d;
              c = 1;
          }
       }
       cout << k<<"\n";
   }
   else
      cout << "0\n";
   c=1; k=0;
   }
    return 0;

}
Rustambek_UWED Re: test2 [1] // Problem 1355. Bald Spot Revisited 12 Apr 2008 02:06
Excuse me
but your algo is wrong.

input:
5
1 1000000000
1 1000000000
1 1000000000
2 10
2 10

your answer:
19
0
0
2
0

right anse:
19
19
19
2
2

Check it up!..
Press any key to continue . . .
Viktor Krivoshchekov`~ Re: test2 // Problem 1355. Bald Spot Revisited 19 Jan 2019 15:09
thx