Anik_Akash

icpc

Mar 26th, 2021 (edited)
170
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int t;
  2.    scanf("%d",&t);
  3.    for(int j=1; j<=t; j++)
  4.    {
  5.         int n,k, ans, tmp=0;
  6.         scanf("%d %d",&n,&k);
  7.          int c = ceil(1/k*1.0);
  8.         for( int i=1; i<=n; i++)
  9.         {
  10.             ans = pow(i,c);
  11.             if(i%ans==0)tmp++;
  12.         }
  13.         printf("Case #%d: %d\n",j,tmp);
  14.    }
RAW Paste Data