The Kronos Agency never leaves loose ends. After an internal leak, director Clara Voss suspects that part of her network of informants has been compromised. The organization consists of agents connected to each other through direct communication channels. By design, the network avoids redundancies: between any pair of agents, there exists a unique possible chain of contacts.
To contain the damage, Clara must activate exactly $$$k$$$ agents. The activated agents will receive a special protocol and will operate in enhanced undercover mode. The rest will remain inactive, under observation.
Each direct channel that connects an activated agent with one that is not activated becomes a critical point of cross-monitoring. These points allow for information verification and detection of possible betrayals. The more there are, the greater the internal control capacity.
Clara needs to decide which agents to activate so that the number of these critical channels is maximum.
Your task is to help her.
The first line contains an integer $$$T$$$, the number of cases to process.
For each case:
For each case, print a single integer: the maximum number of direct channels that can connect an activated agent with a non-activated one, activating exactly $$$k$$$ agents.
33 21 22 35 21 21 31 41 52 01 2
230
| Name |
|---|


