fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;cin>>t;
  7. while(t--){
  8. int x;
  9. cin>>x;
  10. if(x<=100){
  11. cout<<x<<"\n";
  12. }
  13. else if(x>100 && x<=1000){
  14. cout<<(x-25)<<"\n";
  15. }
  16. else if(x>1000 && x<=5000){
  17. cout<<(x-100)<<"\n";
  18. }
  19. else{
  20. cout<<(x-500)<<"\n";
  21. }
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5348KB
stdin
4
15
70
250
1000
stdout
15
70
225
975