problem url: http://acm.timus.ru/problem.aspx?space=1&num=1044
This issue require some math trick, we shoud use "Permutations" here:





























































problem url: http://acm.timus.ru/problem.aspx?space=1&num=1044
This issue require some math trick, we shoud use "Permutations" here: