Comments

There is no such problem exists. I'm trying to solve a real-life problem, not in a programming contest.

The comment is hidden because of too negative feedback, click here to view it

P/Q mod MOD means we're looking at P*x mod MOD where x is the modular inverse of Q mod MOD, which means that Q*x mod MOD = 1. So, Find the modular inverse MI for Q mod MOD. P*=MI; ans=P%MOD;

only 6 if else conditions are enough to solve this problem.

http://codeforces.me/contest/887/submission/32033187

"a tank in the cell n can only move to the cell n - 1, a tank in the cell 1 can only move to the cell 2"

0

No. The answer is always "Karen".