Saleh127

uva12555

May 19th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define sc(a) scanf("%lld",&a)
  6. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  7. #define pf(a) printf("%lld",a)
  8. #define loop1(i,a,c) for(i=a;i<=c;i++)
  9. #define loop(i,c) for(i=0;i<c;i++)
  10. int main()
  11. {
  12. int T;
  13. cin >> T;
  14. string a;
  15. int f;
  16. getchar();
  17. for (int t = 1; t <= T; ++t)
  18. {
  19. cin >> f >> a;
  20. double cost = f*0.5;
  21. if (a.size()>= 4 && a[3]!=' ')
  22. cost+= (a[3] - '0') * 0.05;
  23. cout << "Case " << t << ": " << cost << '\n';
  24. }
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment