#include<stdio.h> int t, x, y; int main() { scanf("%d", &t); while (t--) { scanf("%d %d", &x, &y); for (int i = 1;; i++) if (y - x <= (long long)(i / 2)*(i / 2 + 1) + i % 2 * (i / 2 + 1)) { printf("%d\n", i); break; } } return 0; }
1011번: Fly me to the Alpha Centauri
https://www.acmicpc.net/problem/1011
피드 구독하기:
댓글
(
Atom
)
댓글 없음 :
댓글 쓰기