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:||ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.3.2, CPP 6.3, CPP14, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYPY, PYTH, PYTH 3.5, RUBY, SCALA, SCM chicken, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC|
Fetching successful submissions
If you are still having problems, see a sample solution here.