/* Greedy strategy: 1. If Tian Ji's fastest horse is faster than Qi Wang's fastest horse, then the two are compared. (Because Tianji's other horses may not win, so the comparison between them) 2. If Tianji's fastest horse is slower than Qi Wang's fastest horse, then Tian Ji's slowest horse and Qi Wang's fastest horse ratio are used. (Because none of the horses can win the fastest horse of Qi Wang, use the least loss to compare it with him.) 3. If it is equal, compared with Tianji's slowest horse and Qi Wang's slowest horse, Tianji's slowest horse is faster than Qi Wang's slowest horse. (Tian Ji's slowest horse wins if he can win one, and Qi Wang's slowest horse must have a comparison with him, so the smallest one is faster than him .) 3.2. For others, the slowest horse in the field and the fastest horse-to-horse ratio of Qi Wang. (All horses are faster than Tian Ji's slowest horse, so this horse will lose. The greatest contribution will be selected, and the fastest horse from Qi Wang will be killed )*/
# include
# include
# include
# define Nmax 1010 # define max (A, B) (A> B? A: B) # define min (a, B) (a
King [max2]) {res + = 200; max1 --; max2 --;} else if (Tian [max1]
King [min2]) {res + = 200; min1 ++; min2 ++ ;} else {If (Tian [min1]