| Infoleague Spring 2022 Round Div. 2 |
|---|
| Finished |
I don't mind...
You are given an array $$$A$$$ of $$$N$$$ numbers and an integer $$$T$$$. Find the number of tuples of indices $$$(i,j,k,l)$$$ such that $$$\lfloor \frac{A_i}{A_j} \rfloor + \lfloor \frac{A_k}{A_l} \rfloor$$$ = $$$T$$$.
Two tuples are $$$A$$$ and $$$B$$$ are distinct if there exists some $$$i$$$ such that $$$A_i \neq B_i$$$. For example , (1,1,2,4) is not the same as (1,2,1,4). Note that there may be repetitions.
Print the answer modulo $$$MOD$$$.
The input consists of $$$N$$$,$$$T$$$ and $$$MOD$$$ followed by an array $$$A$$$ of size $$$N$$$.
Print one integer : The number of tuples modulo $$$MOD$$$.
3 2 666013 1 1 1
81
10 2 9821672 372960 389034 286291 199826 189342 219065 129531 340535 69643 177416
2410
In the first sample it is easy to see that every possible tuple is good since $$$\lfloor \frac{1}{1} \rfloor + \lfloor \frac{1}{1} \rfloor = 2$$$. Thus print $$$3^4$$$ mod $$$666013 = 81$$$.
The second sample has a beautiful explination , but unfortunately it is too long to write.
| Name |
|---|


