{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIt is very hard to wash and especially to dry clothes in winter. But Jane is a very smart girl. She is not afraid of this boring process. Jane has decided to use a radiator to make drying faster. But the radiator is small, so it can hold only one thing at a time.\u003c/p\u003e\u003cp\u003eJane wants to perform drying in the minimal possible time. She asked you to write a program that will calculate the minimal time for a given set of clothes.\u003c/p\u003e\u003cp\u003eThere are \u003ci\u003en\u003c/i\u003e clothes Jane has just washed. Each of them took \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e water during washing. Every minute the amount of water contained in each thing decreases by one (of course, only if the thing is not completely dry yet). When amount of water contained becomes zero the cloth becomes dry and is ready to be packed.\u003c/p\u003e\u003cp\u003eEvery minute Jane can select one thing to dry on the radiator. The radiator is very hot, so the amount of water in this thing decreases by \u003ci\u003ek\u003c/i\u003e this minute (but not less than zero — if the thing contains less than \u003ci\u003ek\u003c/i\u003e water, the resulting amount of water will be zero).\u003c/p\u003e\u003cp\u003eThe task is to minimize the total time of drying by means of using the radiator effectively. The drying process ends when all the clothes are dry.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cspan lang\u003d\"en-us\"\u003e\u003cp\u003eThe first line contains a single integer \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 100 000). The second line contains \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e separated by spaces (1 ≤ \u003ci\u003ea\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e). The third line contains \u003ci\u003ek\u003c/i\u003e (1 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e).\u003c/p\u003e\u003c/span\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eOutput a single integer — the minimal possible number of minutes required to dry all clothes.\u003c/p\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\u003e\u0026lt;b\u0026gt;sample input #1\u0026lt;/b\u0026gt;\r\n3\r\n2 3 9\r\n5\r\n\r\n\u0026lt;b\u0026gt;sample input #2\u0026lt;/b\u0026gt;\r\n3\r\n2 3 6\r\n5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e\u0026lt;b\u0026gt;sample output #1\u0026lt;/b\u0026gt;\r\n3\r\n\r\n\u0026lt;b\u0026gt;sample output #2\u0026lt;/b\u0026gt;\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}