Here you will find solutions of many problems on spoj. If you want solution of some problem which is not listed in blog or have doubt regarding any spoj problem (which i have solved) or any programming concept (data structure) you can mail me @ raj.nishant360@gmail.com

And my humble request to you all that don't copy the code only try to understand the logic and algorithm behind the code. I have started this because if you tried as hard as you can and still can't find any solution to the problem then you can refer to this.
You can read my answer how to start competitive programming CLICK HERE

Tuesday, February 4, 2014

ATOMS - Atoms in the Lab

                           ATOMS

Mr.Yagami scientist in Bhabha Atomic Research Centre is not gonna be bother anymore. Here is a solution to his query……

#include<stdio.h>

int main()
{
    long long n,k,m,pro;    int t,i;

    scanf("%i",&t);

    while(t--)
    {
        scanf("%lld%lld%lld",&n,&k,&m);

        i=0;

       if(k <= m/n)
       {
           i++;

           pro = n*k;

           while( k <= m/pro)
           {
               i++;
               pro *= k;
           }

       }

        printf("%i\n",i);
    }
    return 0;
}




1 comment:

  1. The intensity of articles can with out issues be felt of this weblog. Very specific and without delay to the mark. I understood with out difficulty the problem of fact which the author of this weblog wanted to deliver thru his mind. looking for more. Mycotoxins mold

    ReplyDelete

Your comment is valuable to us