Advertisement
jakaria_hossain

lightoj - 1241 - Pinocchio

Aug 22nd, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement