Advertisement
ekzolot

Untitled

Sep 11th, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int divide(int a, int b){
  4. if (a%b==0){
  5. return a/b;
  6. }
  7. return a/b+1;
  8. }
  9. int main(){
  10. int n;
  11. cin>>n;
  12. int answer;
  13. int t=n/2;
  14. if (n%2==0){
  15. answer=2*divide(t, 3);
  16. }else{
  17. answer=(2*divide(t+1, 3))-1;
  18. }
  19. cout<<answer<<" "<<n<<"\n";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement