Calculate the formula by ZED.CWT

while 9:Q,W,E,R,T,Y,U=map(int,raw_input().split());A,S,D,F=1,0,0,1;exec('Q,W,E,R,A,S,D,F=(V%M for V in(Q*Q+W*E,Q*W+W*R,E*Q+R*E,E*W+R*R,A*Q+S*E,A*W+S*R,D*Q+F*E,D*W+F*R));'*U);print(A*T+S*Y)%M,(D*T+F*Y)%M

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)


return to the top page