Doubt on codeforces contest

my code

the problem-
https://codeforces.com/contest/1514/problem/A

I could not understand why its giving an runtimeerror on test 2 ,its a pretty simple question.

you are multiplying the array element
but you need not to do so

Correct Approach

check for each element

If any element is not a perfect square, the answer is yes. Otherwise, the answer is no, because a2∗b2∗…=(a∗b∗…)2a2∗b2∗…=(a∗b∗…)2.

ok .I have understood

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

WHAT I wss doing how was that approach logically incorrect

you are multiplying numbers one by one and taking square root
this will definitely leads to runtime error because of constraints

t (1≤ t ≤100) — the number of test cases.
n (1≤ n ≤100) — the length of the array a.

(1≤ ai ≤10^4) — the elements of the array a.