fork(2) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int t;
  8. unsigned long long n;
  9. cin>>t;
  10. for(int i=0;i<t;i++)
  11. {
  12. cin>>n;
  13. if(n<15)
  14. {
  15. cout<<15<<endl;
  16. }
  17. else
  18. {
  19. if(n%15>7)
  20. {
  21. n+=15-(n%15);
  22. cout<<n<<endl;
  23. }
  24. else
  25. {
  26. n-=(n%15);
  27. cout<<n<<endl;
  28. }
  29. }
  30.  
  31. }
  32.  
  33. return 0;
  34. }
  35.  
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty