Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int func(int a, int b) {
- int res = a / b, mod = a % b;
- if (b % 2 == 0 && mod >= b / 2)
- ++ res;
- else if (b % 2 != 0 && mod > b / 2)
- ++ res;
- return res;
- }
- int main(void) {
- int a, b, c;
- scanf("%d%d", &a, &b);
- printf("%d\n", func(a, b));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement