NYOJ-rock (6)

Source: Internet
Author: User

NYOJ-rock (6)
Stone (6) Time Limit: 1000 MS | memory limit: 65535 KB difficulty: 3

Description
Recently, the PIAOYI and HRDV of TopCoder were boring, so I thought of a game. The game was like this: There were n piles of stones, and two people took turns to take some stones from one of them, the last one cannot be the loser. Note: You can only get any one from the heap at a time. You can get the heap, but you cannot cancel it. Let's assume PIAOYI gets the stones first and asks you to help him determine whether he can win (if they do not make mistakes during the process, they are smart enough ).
Input
Input n in the first line, which indicates there are n groups of test data (n <= 10000)
The test data in each of the following groups contains two rows: the first row contains an integer m, which indicates that the test data in this group has m (m <= 1000) Heap stones;
: Row 2: contains the m integer Ai (Ai <= 100), representing the number of I-heap stones, respectively.
Output
If PIAOYI wins and outputs "PIAOYI", otherwise, output "HRDV". Note that each group occupies one row ..
Sample Input
321 133 8 1125 10
Sample output
HRDVHRDVPIAOYI

Code:

#include
     
      int main(){int T;scanf("%d",&T);while(T--){int n,i,k=0,t;scanf("%d",&n);for(i=0;i
      
       

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.