CF283E Cow Tennis Tournament

Description

Farmer John is hosting a tennis tournament with his $ n $ cows. Each cow has a skill level $ s_{i} $ , and no two cows having the same skill level. Every cow plays every other cow exactly once in the tournament, and each cow beats every cow with skill level lower than its own. However, Farmer John thinks the tournament will be demoralizing for the weakest cows who lose most or all of their matches, so he wants to flip some of the results. In particular, at $ k $ different instances, he will take two integers $ a_{i},b_{i} $ $ (a_{i}

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first sample, cow 3 > cow 1, cow 3 > cow 2, and cow 2 > cow 1. However, the results between cows 1 and 2 and cows 2 and 3 are flipped, so now FJ's results show that cow 1 > cow 2, cow 2 > cow 3, and cow 3 > cow 1, so cows 1, 2, and 3 form a balanced triple.