{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"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. \u003cbr\u003e\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]. \u003cbr\u003e\u003cbr\u003eBut some cows are strong and some are weak. Given two cows: cow\u003csub\u003ei\u003c/sub\u003e and cow\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\u003csub\u003ei\u003c/sub\u003e is stronger than cow\u003csub\u003ej\u003c/sub\u003e.\u003cbr\u003e\u003cbr\u003eFor each cow, how many cows are stronger than her? Farmer John needs your help!"}},{"title":"Input","value":{"format":"HTML","content":"The input contains multiple test cases.\u003cbr\u003eFor each test case, the first line is an integer N (1 \u0026lt;\u003d N \u0026lt;\u003d 10\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\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.\u003cbr\u003e\u003cbr\u003eThe end of the input contains a single 0."}},{"title":"Output","value":{"format":"HTML","content":"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\u003csub\u003ei\u003c/sub\u003e.\u003cbr\u003e"}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n1 2\r\n0 3\r\n3 4\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"Huge input and output,scanf and printf is recommended."}}]}