#include<cstdio> int s, k, t; int main() { for (scanf("%d", &t); t--;) { scanf("%d%d", &s, &k); if (k & 1) printf("%d\n", s & 1); else { s %= k + 1; printf("%d\n", s / k*k + s % 2); } } return 0; }
5386번: Doubloon Game
https://www.acmicpc.net/problem/5386
라벨:
풀이쓸예정
,
BOJ
,
topological game
피드 구독하기:
댓글
(
Atom
)
댓글 없음 :
댓글 쓰기