#P12975. 疯狂星期四
疯狂星期四
Background
Source: TYCPC 4th, Check: not_clever_syl.
Alice wants to train Bob’s “tree hollow” skills.
Problem Description
Alice says that every day, Bob just needs to fill in a table, which is a matrix. In each cell, he can write a number .
Alice will check this table. If the sum of the numbers in all cells is divisible by , Alice will take Bob to eat Crazy Thursday.
Bob really likes going to eat Crazy Thursday, but to prevent Bob from filling in the same table repeatedly, Alice added a rule that the way of filling it in must be different every day.
Bob wants to know the maximum number of times he can eat Crazy Thursday.
Since Bob thinks this number may be very large, you only need to output this number modulo .
Input Format
Input one integer .
Output Format
One line, one integer, representing the answer modulo .
1
2
Hint
For all testdata, .
Translated by ChatGPT 5