fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long int n;
  6. cin >> n;
  7. long long int a = 2, b = 3;
  8. if ((n==1 || n==2) || n==3) cout << n;
  9. else {
  10. while (a*2 <= n) a *=2;
  11. while (b*2 <= n) b*= 2;
  12. cout << max(a, b);
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 15232KB
stdin
363
stdout
256