Codeforces Round 850 (Div. 2, based on VK Cup 2022 - Final Round)
A1
Non-alternating Deck (easy version)
Codeforces
800
原题
←A2 →
翻译中…

This is an easy version of the problem. In this version, all cards have the same color.

翻译中…

Alice has $n$ cards, each card is white, and the cards are stacked in a deck. Alice deals the cards to herself and to Bob, dealing at once several cards from the top of the deck in the following order: one card to herself, two cards to Bob, three cards to Bob, four cards to herself, five cards to herself, six cards to Bob, seven cards to Bob, eight cards to herself, and so on. In other words, on the $i$-th step, Alice deals $i$ top cards from the deck to one of the players; on the first step, she deals the cards to herself and then alternates the players every two steps. When there aren't enough cards at some step, Alice deals all the remaining cards to the current player, and the process stops.

翻译中…

image First Alice's steps in a deck of many cards.

翻译中…

How many cards will Alice and Bob have at the end?

翻译中…

Input

翻译中…

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 200$). The description of the test cases follows

翻译中…

The only line of each test case contains a single integer $n$ ($1 \le n \le 10^6$) — the number of cards.

翻译中…

Output

翻译中…

For each test case print two integers — the number of cards in the end for each player — in this order: cards Alice has, cards Bob has.

翻译中…

样例

Input #1
5
10
6
17
8
1000000
Output #1
5 5
1 5
10 7
3 5
500202 499798
InputCopy OutputCopy
题目信息
题号
1786A1
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。