In the Araragi household, there is a fridge that contains an infinite amount of Haagendaz numbered $$$1, 2, 3, \dots $$$. Koyomi and Tsukihi both love Haagendaz but have some level of guilt ($$$K$$$ for Koyomi and $$$T$$$ for Tsukihi) that dictates the maximum amount of Haagendaz they can eat in one sitting. Both Koyomi's and Tsukihi's guilt levels start at $$$1$$$ and will increase when they see the other person eating Haagendaz. In particular, whenever someone sees the other person eats $$$x$$$ Haagendaz in one sitting, they will increase their own guilt level by $$$x$$$. Tsukihi will eat the maximum number of Haagendaz her guilt level allows, the following day, Koyomi will eat the maximum number of Haagendaz his guilt level allows, then the next day Tsukihi will eat the maximum number of Haagendaz, etc.
Handle $$$n$$$ questions of the form $$$x$$$, where you must determine who will eat the $$$x$$$'th Haagendaz.
The first line contains a singular integer $$$n$$$ $$$(1 \leq n \leq 10^5)$$$.
The second line contains $$$n$$$ spaced integers $$$x_{1 \dots n}$$$, the $$$i$$$'th denoting a question about the $$$x_i$$$'th Haagendaz $$$(1 \leq x_i \leq 10^{18})$$$.
—
Tests are numbered from $$$1 \dots 10$$$ with samples skipped. Each test is worth $$$\frac{100}{10} = 10$$$ points.
Tests $$$1 - 5$$$ satisfy $$$x_i \leq 10^6$$$.
The remaining tests do not satisfy any additional constraints.
Output a string of length $$$n$$$, the $$$i$$$'th character being $$$T$$$ if Tsukihi eats $$$x_i$$$'th Haagendaz or $$$K$$$ otherwise (Koyomi eats it).
111 2 3 4 5 6 7 8 9 10 3366
TKKTTTKKKKK
Initially, $$$T = 1$$$ and $$$K = 1$$$.
Tsukihi will eat $$$1$$$ Haagendaz (the $$$1$$$st) on day $$$1$$$. Then Koyomi, seeing Tsuhiki eat that Haagendaz, will increase his guilt level by $$$1$$$.
Now $$$T = 1$$$ and $$$K = 2$$$.
Koyomi will eat the next $$$2$$$ Haagendaz (the $$$2$$$nd and $$$3$$$rd). Then Tsuhiki, seeing Koyomi eat $$$2$$$ Haagendaz, will increase her guilt level by $$$2$$$.
Now $$$T = 3$$$ and $$$K = 2$$$.
Tsuhiki will eat the next $$$3$$$ Haagendaz (the $$$4$$$th, $$$5$$$th, and $$$6$$$th). Then Koyomi, seeing Tsuhiki eat $$$3$$$ Haagendaz will increase his guilt level by $$$3$$$.
Now $$$T = 3$$$ and $$$K = 5$$$.
Koyomi will eat the next $$$5$$$ Haagendaz (the $$$7$$$th, $$$8$$$th, $$$9$$$th, $$$10$$$th, and $$$11$$$th). And so on.
Unfortunately, I do not have the space to explain why Koyomi eats the $$$3366$$$th Haagendaz.
—
Problem Idea: Helen
Problem Preparation: 3366
Occurrences: Novice 4
| Name |
|---|


