Game Theory -1 Challenges

Cannot unnderstand the question and how to get the output.please explain

For N pile
For m stones each:
Find divisors of m
Let say a1,a2,a3…an
Grundy(m)=Max(Grundy(a1),Grundy(a2),Grundy(a3),…)
Ans=2 if((Grundy(m)==0)||(n%2==0))
else
Ans=1
do all these things in optimized way.

i am not able to understand.Please elaborate more

I think , Grundy Topic is not clear to you. First of all, go through the videos again and try building your logics of how to solve Grundy Questions.
FOR 1 Pile:
if Grundy (n)==0 First Loose otherwise wins
FOR N piles having m1,m2,… stones
if Grundy(m1) ^ Grundy(m2) ^ Grundy(m3),… !=0 then First wins otherwise First loose.
and try to solve the questions again.