CF773F Test Data Generation

Description

Test data generation is not an easy task! Often, generating big random test cases is not enough to ensure thorough testing of solutions for correctness. For example, consider a problem from an old Codeforces round. Its input format looks roughly as follows: The first line contains a single integer $ n $ ( $ 1

Input Format

The only line contains three integers $ max_{n} $ , $ max_{a} $ and $ q $ ( $ 1

Output Format

Output a single integer — the number of test cases which satisfy the constraints and make both wrong solutions output an incorrect answer, modulo $ q $ .

Explanation/Hint

In the first example, interesting test cases look as follows: `

1 1 1 3

2 4 6 2 4 6

`