Promi_38

cf 979A

Dec 24th, 2020 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     long long n;
  6.     scanf("%lld", &n);
  7.    
  8.     if(n == 0) printf("0\n");        //if no friend comes, pizza won't be required
  9.     else if(n % 2 == 0) printf("%lld\n", n + 1);
  10.     else printf("%lld\n", (n + 1) / 2);
  11. }
Add Comment
Please, Sign In to add comment