{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Farmer John\u0027s cows have discovered that the clover growing along the ridge of the hill (which we can think of as a one-dimensional number line) in his field is particularly good. \n \u003cbr\u003e \n \u003cbr\u003eFarmer John has N cows (we number the cows from 1 to N). Each of Farmer John\u0027s N cows has a range of clover that she particularly likes (these ranges might overlap). The ranges are defined by a closed interval [S,E]. \n \u003cbr\u003e \n \u003cbr\u003eBut some cows are strong and some are weak. Given two cows: cow\n \u003csub\u003ei\u003c/sub\u003e and cow\n \u003csub\u003ej\u003c/sub\u003e, their favourite clover range is [Si, Ei] and [Sj, Ej]. If Si \u0026lt;\u003d Sj and Ej \u0026lt;\u003d Ei and Ei - Si \u0026gt; Ej - Sj, we say that cow\n \u003csub\u003ei\u003c/sub\u003e is stronger than cow\n \u003csub\u003ej\u003c/sub\u003e. \n \u003cbr\u003e \n \u003cbr\u003eFor each cow, how many cows are stronger than her? Farmer John needs your help!\n \u003c/div\u003e\n\n\u003cp\u003e题目翻译\u003c/p\u003e\n\u003cp\u003e农夫约翰的牛发现,他的田地里沿着山脊生长的三叶草(我们可以将其视为一维数字线)特别好。\u003c/p\u003e\n\n\u003cp\u003e农夫约翰有N头母牛(我们将母牛的编号从1到N)。每位农夫约翰的N头母牛都有她特别喜欢的三叶草范围(这些范围可能重叠)。范围由闭合间隔[S,E]定义。\u003c/p\u003e\n\n\u003cp\u003e但是有些母牛很强壮,有些却很弱。给定两个母牛:母牛i和母牛j,它们最喜欢的三叶草范围是[Si,Ei]和[Sj,Ej]。如果Si \u003c\u003d Sj并且Ej \u003c\u003d Ei并且Ei-Si\u003e Ej-Sj,我们说母牛i比母牛j强。\u003c/p\u003e\n\n\u003cp\u003e对于每头母牛,有几头母牛比她强?农夫约翰需要您的帮助!\u003c/p\u003e\n\n\u003cp\u003e输入项\u003c/p\u003e\n\n\u003cp\u003e输入包含多个测试用例。\u003c/p\u003e\n\n\u003cp\u003e对于每个测试用例,第一行是整数N(1 \u003c\u003d N \u003c\u003d 10 ^ 5),它是母牛的数量。然后是N行,其第i行包含两个整数:S和E(0 \u003c\u003d S\u003c\u003dE\u003c\u003d1e5 )\n\n\u003cp\u003e输入的末尾包含单个0。\u003c/p\u003e\n\n\u003cp\u003e输出量\u003c/p\u003e\n\u003cp\u003e对于每个测试用例,输出一行包含n个以空格分隔的整数,其中第i个数字指定比母牛i强的母牛的数量。\u003c/p\u003e\n\n\u003cp\u003eSample Input\u003c/p\u003e\n\u003cp\u003e3\u003c/p\u003e\n\u003cp\u003e1 2\u003c/p\u003e\n\u003cp\u003e0 3\u003c/p\u003e\n\u003cp\u003e3 4\u003c/p\u003e\n\u003cp\u003e0\u003c/p\u003e\n\u003cp\u003eSample Output\u003c/p\u003e\n\u003cp\u003e1 0 0\u003c/p\u003e\n\u003cp\u003eHint\u003c/p\u003e\n\u003cp\u003eHuge input and output,scanf and printf is recommended.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n The input contains multiple test cases. \n \u003cbr\u003eFor each test case, the first line is an integer N (1 \u0026lt;\u003d N \u0026lt;\u003d 10\n \u003csup\u003e5\u003c/sup\u003e), which is the number of cows. Then come N lines, the i-th of which contains two integers: S and E(0 \u0026lt;\u003d S \u0026lt; E \u0026lt;\u003d 10\n \u003csup\u003e5\u003c/sup\u003e) specifying the start end location respectively of a range preferred by some cow. Locations are given as distance from the start of the ridge. \n \u003cbr\u003e \n \u003cbr\u003eThe end of the input contains a single 0.\n \u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n For each test case, output one line containing n space-separated integers, the i-th of which specifying the number of cows that are stronger than cow\n \u003csub\u003ei\u003c/sub\u003e. \n \u003cbr\u003e\n \u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e3\n1 2\n0 3\n3 4\n0\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e1 0 0\n\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n Huge input and output,scanf and printf is recommended.\n \u003c/div\u003e"}}]}