N, are all standing in a row . Each cow has a breed ID: 1 for Holsteins, 2 for Guernseys, and 3 for Jerseys. Farmer John would like your help counting the number of cows of each breed that lie within certain intervals of the ordering.
Farmer John's NN cows, conveniently numbered 1…N1…N, are all standing in a row (they seem to do so often that it now takes very little prompting from Farmer John to line them up). Each cow has a breed ID: 1 for Holsteins, 2 for Guernseys, and 3 for Jerseys. Farmer John would like your help counting the number of cows of each breed that lie within certain intervals of the ordering.
![HBC24046小宝构造等差数列[USACO 2015 Dec S]Breed Counting题解
-第1张图片-东莞河马信息技术 HBC24046小宝构造等差数列[USACO 2015 Dec S]Breed Counting题解
-第1张图片-东莞河马信息技术](https://www.xxstcz.com/zb_users/upload/2023/11/20231110213302169962318218449.jpeg)
(图片来源网络,侵删)