SHARE
TWEET

lightoj - 1241 - Pinocchio

jakaria_hossain Aug 22nd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. int main()
  5. {
  6.     int te;
  7.     cin>>te;
  8.     for(int t=1;t<=te;t++)
  9.     {
  10.         int n;
  11.         cin>>n;
  12.         int ara[n+1];
  13.         for(int i=0;i<n;i++)cin>>ara[i];
  14.         double x=ara[0]-2;
  15.         int cnt;
  16.         cnt= ceil(x/5.0);
  17.         for(int i=1;i<n;i++)
  18.         {
  19.             x=ara[i]-ara[i-1];
  20.             cnt+=ceil(x/5.0);
  21.         }
  22.         printf("Case %d: %d\n",t,cnt);
  23.     }
  24. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top