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

test2
Posted by Igor 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;

}
Re: test2
Posted by Rustambek_UWED 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 . . .
Re: test2
Posted by Viktor Krivoshchekov`~ 19 Jan 2019 15:09
thx