307857: CF1425H. Huge Boxes of Animal Toys

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Huge Boxes of Animal Toys

题意翻译

### 题目描述 Chaneka有很多玩具,每个玩具都有自己的价值,Chaneka通过它们的价值给玩具分类: - 一号箱装价值在$(-∞,-1]$的玩具. - 二号箱装价值在$(-1,0)$的玩具. - 三号箱装价值在$(0,1)$的玩具. - 四号箱装价值在$[1,∞)$的玩具. 现在Chaneka希望做出"超级玩具",这个超级玩具的价值为所有玩具价值的乘积,而我们规定这个玩具所属的箱子为特别箱子.求哪些箱子可能成为特别箱子. ### 输入输出格式 第一行输入一个整数 $T(1 \leq T \leq 5 \times 10^4)$表示测试数据个数. 接下来对于每个测试数据输入一行四个整数$A,B,C,D(0 \leq A,B,C,D \leq 10^6,A+B+C+D>0)$分别表示一,二,三,四号箱的玩具个数. 对于每个测试数据,输出四个字符串:"Ya"或"Tidak",第$i$个表示第$i$号箱能否成为特别箱子("Ya"表示能,"Tidak"表示不能). ### 样例解释 对于测试数据一,当玩具价值分别为$-3,-0.5,-0.5,3$时会使一号箱成为特殊箱子,而当价值分别为$-3,-0.33,-0.25,3$时会使二号箱成为特殊箱子. 对于测试数据二,只有一个玩具,因此根据定义它自己就是超级玩具.

题目描述

Chaneka has a hobby of playing with animal toys. Every toy has a different fun value, a real number. Chaneka has four boxes to store the toys with specification: - The first box stores toys with fun values in range of $ (-\infty,-1] $ . - The second box stores toys with fun values in range of $ (-1, 0) $ . - The third box stores toys with fun values in range of $ (0, 1) $ . - The fourth box stores toys with fun value in range of $ [1, \infty) $ . Chaneka has $ A $ , $ B $ , $ C $ , $ D $ toys in the first, second, third, and fourth box, respectively. One day she decides that she only wants one toy, a super toy. So she begins to create this super toy by sewing all the toys she has. While the number of toys Chaneka has is more than 1, she takes two different toys randomly and then sews them together, creating a new toy. The fun value of this new toy is equal to the multiplication of fun values of the sewn toys. She then puts this new toy in the appropriate box. She repeats this process until she only has one toy. This last toy is the super toy, and the box that stores this toy is the special box. As an observer, you only know the number of toys in each box initially but do not know their fun values. You also don't see the sequence of Chaneka's sewing. Determine which boxes can be the special box after Chaneka found her super toy.

输入输出格式

输入格式


The first line has an integer $ T $ $ (1 \le T \le 5 \cdot 10^4) $ , the number of test cases. Every case contains a line with four space-separated integers $ A $ $ B $ $ C $ $ D $ $ (0 \le A, B, C, D \le 10^6, A + B + C + D > 0) $ , which denotes the number of toys in the first, second, third, and fourth box, respectively.

输出格式


For each case, print four space-separated strings. Each string represents the possibility that the first, second, third, and fourth box can be the special box from left to right. For each box, print "Ya" (Without quotes, Indonesian for yes) if that box can be the special box. Print "Tidak" (Without quotes, Indonesian for No) otherwise.

输入输出样例

输入样例 #1

2
1 2 0 1
0 1 0 0

输出样例 #1

Ya Ya Tidak Tidak
Tidak Ya Tidak Tidak

说明

For the first case, here is a scenario where the first box is the special box: - The first box had toys with fun values $ \{-3\} $ . - The second box had toys with fun values $ \{ -0.5, -0.5 \} $ - The fourth box had toys with fun values $ \{ 3 \} $ The sewing sequence: 1. Chaneka sews the toy with fun $ -0.5 $ and $ -0.5 $ to a toy with fun $ 0.25 $ and then put it in the third box. 2. Chaneka sews the toy with fun $ -3 $ and $ 0.25 $ to a toy with fun $ -0.75 $ and then put it in the second box. 3. Chaneka sews the toy with fun $ -0.75 $ and $ 3 $ to a toy with fun $ -1.25 $ and then put it in the first box, which then became the special box. Here is a scenario where the second box ends up being the special box: - The first box had toys with fun values $ \{-3\} $ - The second box had toys with fun values $ \{ -0.33, -0.25 \} $ . - The fourth box had toys with fun values $ \{ 3 \} $ . The sewing sequence: 1. Chaneka sews the toy with fun $ -3 $ and $ -0.33 $ to a toy with fun $ 0.99 $ and then put it in the third box. 2. Chaneka sews the toy with fun $ 0.99 $ and $ 3 $ to a toy with fun $ 2.97 $ and then put in it the fourth box. 3. Chaneka sews the toy with fun $ 2.97 $ and $ -0.25 $ to a toy with fun $ -0.7425 $ and then put it in the second box, which then became the special box. There is only one toy for the second case, so Chaneka does not have to sew anything because that toy, by definition, is the super toy.

Input

题意翻译

### 题目描述 Chaneka有很多玩具,每个玩具都有自己的价值,Chaneka通过它们的价值给玩具分类: - 一号箱装价值在$(-∞,-1]$的玩具. - 二号箱装价值在$(-1,0)$的玩具. - 三号箱装价值在$(0,1)$的玩具. - 四号箱装价值在$[1,∞)$的玩具. 现在Chaneka希望做出"超级玩具",这个超级玩具的价值为所有玩具价值的乘积,而我们规定这个玩具所属的箱子为特别箱子.求哪些箱子可能成为特别箱子. ### 输入输出格式 第一行输入一个整数 $T(1 \leq T \leq 5 \times 10^4)$表示测试数据个数. 接下来对于每个测试数据输入一行四个整数$A,B,C,D(0 \leq A,B,C,D \leq 10^6,A+B+C+D>0)$分别表示一,二,三,四号箱的玩具个数. 对于每个测试数据,输出四个字符串:"Ya"或"Tidak",第$i$个表示第$i$号箱能否成为特别箱子("Ya"表示能,"Tidak"表示不能). ### 样例解释 对于测试数据一,当玩具价值分别为$-3,-0.5,-0.5,3$时会使一号箱成为特殊箱子,而当价值分别为$-3,-0.33,-0.25,3$时会使二号箱成为特殊箱子. 对于测试数据二,只有一个玩具,因此根据定义它自己就是超级玩具.

加入题单

上一题 下一题 算法标签: