fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. using ll = long long;
  4. int main() {
  5. freopen("BAI1.INP","r",stdin);
  6. freopen("BAI1.OUT","w",stdout);
  7. ll N;
  8. while (cin >> N) {
  9. if (N == 1){
  10. cout << 1 << endl;
  11. }
  12. else if (N % 2 == 0){
  13. cout << N / 2 << endl;
  14. }
  15. else {
  16. cout << (N - 1) / 2 <<endl;
  17. }
  18. }
  19. return 0;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
4
7
stdout
2
3