Shriraj and Points
All submissions for this problem are available.
Today, Vishal and Shriraj are playing a game in 2D Cartesian plane. Shriraj is at the location (sx, sy), while Vishal is at (vx,vy).
In one move, Shriraj can:
- Go to (sy, -sx).
- Go to (sx + cx , sy + cy).
Shriraj has to reach to Vishal's location to win the game. Shriraj is wondering if it is possible for him to win, if he plays optimally. As you are one of his students, he assigns the task to you. Find out whether Shriraj can win the game. (He will get a treat from Vishal if he wins.)
Input will contain multiple test cases. The first line of input denotes T, the number of Test cases. T test cases follow.
Each test case contains six space seperated integers, sx, sy, vx, vy, cx, cy. Each test case will be on a seperate line.
Output "Shriraj" (Without quotes), if Shriraj can win. Otherwise output "Vishal" (Without quotes).
- 1 ≤ T ≤ 10
- -109 ≤ sx, sy, vx, vy, cx, cy ≤ 109
Input: 3 0 0 1 1 2 2 2 3 2 3 0 0 0 0 1 1 1 1 Output: Vishal Shriraj Shriraj
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.