fork(1) download
  1. #include <cmath>
  2. #include <iostream>
  3. #include <vector>
  4. #include <algorithm>
  5. #include <string>
  6. #include <set>
  7. #include <map>
  8. #include <list>
  9. #include <time.h>
  10. #include <math.h>
  11. #include <random>
  12. #include <deque>
  13. #include <queue>
  14. #include <cassert>
  15. #include <unordered_map>
  16. #include <unordered_set>
  17. #include <iomanip>
  18. #include <bitset>
  19. #include <sstream>
  20.  
  21. using namespace std;
  22.  
  23. typedef long long ll;
  24.  
  25. mt19937 rnd(228);
  26.  
  27. int main()
  28. {
  29. #ifdef ONPC
  30. freopen("a.in", "r", stdin);
  31. #endif
  32. ios::sync_with_stdio(0);
  33. cin.tie(0);
  34. int t;
  35. cin >> t;
  36. while (t--)
  37. {
  38. int x;
  39. cin >> x;
  40. if (x % 10 == 0)
  41. {
  42. cout << 0 << '\n';
  43. }
  44. else if (x % 5 == 0)
  45. {
  46. cout << 1 << '\n';
  47. }
  48. else
  49. {
  50. cout << -1 << '\n';
  51. }
  52. }
  53. }
  54.  
Success #stdin #stdout 0s 4524KB
stdin
Standard input is empty
stdout
Standard output is empty