shunfurh 于 2017.09.08 20:13 提问

Anniversary

Nahid Khaleh decides to invite the kids of the "Shahr-e Ghashang" to her wedding anniversary. She wants to prepare a square-shaped chocolate cake with known size. She asks each invited person to determine the size of the piece of cake that he/she wants (which should also be square-shaped). She knows that Mr. Kavoosi would not bear any wasting of the cake. She wants to know whether she can make a square cake with that size that serves everybody exactly with the requested size, and without any waste.

Input

The first line of the input file contains a single integer t (1 <= t <= 10), the number of test cases, followed by input data for each test case. Each test case consist of a single line containing an integer s, the side of the cake, followed by an integer n (1 <= n <= 16), the number of cake pieces, followed by n integers (in the range 1...10) specifying the side of each piece.

Output

There should be one output line per test case containing one of the words KHOOOOB! or HUTUTU! depending on whether the cake can be cut into pieces of specified size without any waste or not.

Sample Input

2
4 8 1 1 1 1 1 3 1 1
5 6 3 3 2 1 1 1

Sample Output

KHOOOOB!
HUTUTU!

1个回答

caozhy      2017.09.24 08:32

Windows 10年度更新Anniversary Update预览版开始推送，版本号Build 14328
2015年7月29日发布的Windows 10正式版版本号是Build 10240。微软现在开始推送Windows 10年度更新Anniversary Update，PC和Mobile预览版Build 14328。正式版计划在今年夏天面向全世界用户免费推出。此年度更新版本包括了非常多的新功能：新的开始菜单平板模式改进锁屏CortanaWindows Ink通知中心等其它大量改进。下面是新功能详细介
HDU1520:Anniversary party(树形DP)
Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the superviso
POJ1020-Anniversary Cake

HDU 1520 Anniversary party(简单树形dp)

[ACM] POJ 2342 Anniversary party （树形DP入门题）
Anniversary party Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4410   Accepted: 2496 Description There is going to be a party to celebrate the 80-th Ann
poj2342 Anniversary party（树形dp）
Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5516 Accepted: 3164 Description There is going to be a party to celebrate the 80-th Anniv
photoshop之无法启动adobe update
http://zhidao.baidu.com/question/348706336.html
poj1020--Anniversary Cake题解
<br />原题：http://acm.pku.edu.cn/JudgeOnline/problem?id=1020<br />题目要求我们检测是否能将给定的多个小正方形拼成一个完整的大的正方形。<br />采用搜索遍历的方法：<br />拼凑的方法类似于俄罗斯方块游戏，不同的是每次拼凑的时候必须先找到高度最低的那一列拼凑，如果某一个小正方形不成功的话，则回溯。<br />#include<iostream> using namespace std; const int maxSize = 40;
Mikumikudance
( Mikumikudance+926+64位+Emil繁体汉化版+%2B+MME0.37.zip) ( Mikumikudance+926+64位+Emil繁体汉化版+%2B+MME0.37.zip) 您可以上传小于60MB的文件
HDU 4751 Divide Groups 二分图判断