SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**Bismillahir Rahmanir Rahim.**/
  2. #include<bits/stdc++.h>
  3. #define ln '\n'
  4. #define D(x) cout<< #x " = "<<x<<endl
  5. #define foreach(i,c) for(__typeof(c.begin())i=c.begin();i!=c.end();i++)
  6.  
  7. #define f0(i,b) for(int i=0;i<(b);i++)
  8. #define f1(i,b) for(int i=1;i<=(b);i++)
  9. #define _case cout<<"Case "<<++cs<<": "
  10.  
  11. #define MOD 1000000007
  12. #define countv(v,a) count(v.begin(),v.end(),a)
  13. #define grtsrt(v) sort(v.begin(),v.end(),greater<int>())
  14. #define mnv(v) *min_element(v.begin(),v.end())
  15. #define mxv(v) *max_element(v.begin(),v.end())
  16. #define uniq(v) v.resize( unique(all(v)) - v.begin())
  17.  
  18. #define PI acos(-1)
  19. #define ll long long int
  20. #define ull unsigned long long
  21.  
  22. #define vi vector <int>
  23. #define vll vector <ll>
  24. #define vs vector <string>
  25. #define pb push_back
  26. #define eb emplace_back
  27. #define mpii map <int,int>
  28. #define mpsi map <string,int>
  29. #define mpll map <long long,long long>
  30. #define MP make_pair
  31. #define F first
  32. #define S second
  33.  
  34. #define GCD(a,b) __gcd(a,b)
  35. #define LCM(a,b) (a*(b/__gcd(a,b)))
  36.  
  37. #define rev(v) reverse(v.begin(),v.end())
  38. #define srt(v) sort(v.begin(),v.end())
  39.  
  40. #define all(v) v.begin(),v.end()
  41. #define MEM(a, b) memset(a, b, sizeof(a))
  42.  
  43. #define fast ios_base::sync_with_stdio(false)
  44. using namespace std;
  45.  
  46. const ll INF = 0x3f3f3f3f3f3f3f3f;
  47. const long double EPS = 1e-9;
  48. const int inf = 0x3f3f3f3f;
  49. /// count set bit C = (num * 0x200040008001ULL & 0x111111111111111ULL) % 0xf; /// 32 bit integer
  50.  
  51. /*------------------------------Graph Moves----------------------------*/
  52. //Rotation: S -> E -> N -> W
  53. //const int fx[] = {0, +1, 0, -1};
  54. //const int fy[] = {-1, 0, +1, 0};
  55. //const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
  56. //const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
  57. //const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
  58. //const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
  59. /*---------------------------------------------------------------------*/
  60.  
  61.  
  62. inline bool isSquare(ll x)  { ll s = sqrt(x); return (s*s==x); }
  63. inline bool isFib(ll x) { return isSquare(5*x*x+4)|| isSquare(5*x*x-4); }
  64. inline bool isPowerOfTwo(ll x)   { return ((1LL<<(ll)log2(x))==x); }
  65.  
  66. typedef struct {
  67.     double x,y;
  68.    /// Point() {}
  69.   ///  Point(double x,double y) : x(x), y(y) {}
  70. } Point;
  71.  
  72. double distance(Point a , Point b) {
  73.     return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
  74. }
  75.  
  76. string s,s1;
  77. ll a,b,i,j,d,t,cs=0,counT=0,k,ans=0,l=0,sum1=0,sum=0,Max,Min,num;
  78. int main()
  79. {
  80.     fast ;
  81.   cin >> t;
  82.   f0(i,t)
  83.   {
  84.       long double n,r,p;
  85.       counT = 0 ;
  86.  
  87.       cin >> n >> r >> p ;
  88.        _case;
  89.   //   scanf("%Lf %Lf %Lf ",&n,&r,&p);
  90.       if(n>=p)
  91.       {
  92.         cout << 0 << ln ;
  93.       }
  94.       while(n<p)
  95.       {
  96.           n = n+n*(.01*r);
  97.    //     D(n);
  98.         counT++;
  99.       }
  100.     cout << counT << ln ;
  101.   }
  102.  
  103. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top