USACO 2022 February Contest, Silver Problem 1. Redistributing Gifts
USACO 2022 February Contest, Silver Problem 1. Redistributing Gifts Farmer John has NN gifts labeled 1…N1…N for his NN cows, also labeled 1…N1…N (1≤N≤5001≤N≤500). Each cow has a wishlist, which is ...