F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Link with Equilateral Triangle

Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 529    Accepted Submission(s): 393


Problem Description
Link has a big equilateral triangle with side length $n$. The big triangle consists of $n^2$ small equilateral triangles with side length $1$.

Link is going to fill numbers into each vertex of the small triangle with the following limits:

· The number filled in should be $0$, $1$, or $2$.
· The left side of the big triangle should not be filled with $0$. The right side of the big triangle should not be filled with $1$. The bottom side of the big triangle should not be filled with $2$.
· For each small triangle with side length $1$, the sum of three vertices should not be a multiple of $3$.



Link went crazy when he tried to do so because he couldn't find any triangle satisfying all conditions above. Now, he turns to you for help.

Please tell Link: Is it possible to fill the triangle so that it satisfies all conditions above?
 

Input
Each test contains multiple test cases. The first line contains the number of test cases $T$ ($1 \le T \le 1000$). Description of the test cases follows.

For each test case, there is only one line containing a single integer $n$ ($1 \leq n \leq 10^3$).
 

Output
For each test case, output ${\rm Yes}$ if it is possible to do so. Output ${\rm No}$ if it is impossible to do so.
 

Sample Input
2 1 2
 

Sample Output
No No
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-06-26 13:03:44, Gzip enabled