SOLVE

LATER

Milly and equal array

Problem

Editorial

Analytics

Milly is playing with a Array **A** of size **N**. She wants to make all the values of **A** to be equal. She can multiply any value any number of times by **X**, **Y** and **Z**. Your task is to tell her whether she can do it or not. Print "She can" if she can do it else print "She can't" without "".

- First line of the input will contain
**T**(No. of test cases). - For each test case, first line will contain four space separated integers denoting
**N**,**X**,**Y**and**Z**. Then next line will contain**N**space separated integers of**A**

- For every test case, print the required answer in a new line.

- 1 ≤
**T**≤ 5 - 2 ≤
**N**≤ 10^{5} -
**X, Y, Z**∈ {2, 3, 5, 7} - 1 ≤
**A**≤ 10_{i}^{9}

Explanation

Test case #1: Multiply first value by 2.

Test case #2: Not possible.

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic,
Kotlin

Initializing Code Editor...

{"c91b75e": "/pagelets/problem-author-tester/algorithm/milly-and-equal-array/", "c91b774": "/pagelets/problems-hint/algorithm/milly-and-equal-array/", "c91b744": "/pagelets/suggested-problems/algorithm/milly-and-equal-array/", "c91b789": "/pagelets/recommended-problems/algorithm/milly-and-equal-array/", "c91b717": "/pagelets/show-submission/algorithm/milly-and-equal-array/"}

{}

realtime.hackerearth.com

80

4518bf6df618a43fcffd0ab86c41baa43c72632f

58a29e5cae2309f04b28

/realtime/pusher/auth/