{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"problem_par\"\u003e\n \u003cdiv class\u003d\"problem_par_normal\"\u003e\n Consider a permutation \u003ci\u003ea\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003ea\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, …, \u003ci\u003ea\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e (all \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e are different integers in range from 1 to \u003ci\u003en\u003c/i\u003e). Let us call \u003ci\u003ek-inversion\u003c/i\u003e a sequence of numbers \u003ci\u003ei\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003ei\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e, …, \u003ci\u003ei\u003csub\u003ek\u003c/sub\u003e\u003c/i\u003e such that 1\u0026nbsp;≤\u0026nbsp;\u003ci\u003ei\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e\u0026nbsp;\u0026lt;\u0026nbsp;\u003ci\u003ei\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e\u0026nbsp;\u0026lt;\u0026nbsp;…\u0026nbsp;\u0026lt;\u0026nbsp;\u003ci\u003ei\u003csub\u003ek\u003c/sub\u003e\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;\u003ci\u003en\u003c/i\u003e and \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e\u0026nbsp;\u0026gt;\u0026nbsp;\u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e\u0026nbsp;\u0026gt;\u0026nbsp;…\u0026nbsp;\u0026gt;\u0026nbsp;\u003ci\u003ea\u003csub\u003ei\u003csub\u003ek\u003c/sub\u003e\u003c/sub\u003e\u003c/i\u003e. Your task is to evaluate the number of different \u003ci\u003ek\u003c/i\u003e-inversions in a given permutation.\n \u003c/div\u003e\n \u003c/div\u003e\n "}},{"title":"Input","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"problem_par\"\u003e\n \u003cdiv class\u003d\"problem_par_normal\"\u003e\n The first line contains integers \u003ci\u003en\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e (1\u0026nbsp;≤\u0026nbsp;\u003ci\u003en\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;20000; 2\u0026nbsp;≤\u0026nbsp;\u003ci\u003ek\u003c/i\u003e\u0026nbsp;≤\u0026nbsp;10). The second line is filled with \u003ci\u003en\u003c/i\u003e integers \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e.\n \u003c/div\u003e\n \u003c/div\u003e\n "}},{"title":"Output","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"problem_par\"\u003e\n \u003cdiv class\u003d\"problem_par_normal\"\u003e\n Output the number of different \u003ci\u003ek\u003c/i\u003e-inversions in a given permutation. This number must be taken modulo 10\u003csup\u003e9\u003c/sup\u003e.\n \u003c/div\u003e\n \u003c/div\u003e\n "}},{"title":"Sample 1","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 2\r\n3 1 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","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\u003e5 3\r\n5 4 3 2 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e10\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}