{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tJill likes to ride her bicycle, but since the pretty city of \u003cspan data-scayt_word\u003d\"Greenhills\" data-scaytid\u003d\"1\"\u003eGreenhills\u003c/span\u003e where she lives has grown, Jill often uses the excellent public bus system for part of her journey. She has a folding bicycle which she carries with her when she uses the bus for the first part of her trip. When the bus reaches some pleasant part of the city, Jill gets off and rides her bicycle. She follows the bus route until she reaches her destination or she comes to a part of the city she does not like. In the latter event she will board the bus to finish her trip.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tThrough years of experience, Jill has rated each road on an integer scale of ``niceness.\u0026#39;\u0026#39; Positive niceness values indicate roads Jill likes; negative values are used for roads she does not like. There are not zero values. Jill plans where to leave the bus and start bicycling, as well as where to stop bicycling and re-join the bus, so that the sum of niceness values of the roads she bicycles on is maximized. This means that she will sometimes cycle along a road she does not like, provided that it joins up two other parts of her journey involving roads she likes enough to compensate. It may be that no part of the route is suitable for cycling so that Jill takes the bus for its entire route. Conversely, it may be that the whole route is so nice Jill will not use the bus at all.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tSince there are many different bus routes, each with several stops at which Jill could leave or enter the bus, she feels that a computer program could help her identify the best part to cycle for each bus route.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe input file contains information on several bus routes. The first line of the file is a single integer\u0026nbsp;\u003ci\u003eb\u003c/i\u003e\u0026nbsp;representing the number of route descriptions in the file. The identifier for each route (\u003ci\u003er\u003c/i\u003e) is the sequence number within the data file,\u0026nbsp;\u003cimg align\u003d\"MIDDLE\" alt\u003d\"$1 \\le r \\le b$\" border\u003d\"0\" height\u003d\"32\" src\u003d\"http://uva.onlinejudge.org/external/5/507img1.gif\" width\u003d\"76\" /\u003e. Each route description begins with the number of stops on the route: an integer\u0026nbsp;\u003ci\u003es\u003c/i\u003e,\u0026nbsp;\u003cimg align\u003d\"MIDDLE\" alt\u003d\"$2 \\le s \\le 20,000$\" border\u003d\"0\" height\u003d\"30\" src\u003d\"http://uva.onlinejudge.org/external/5/507img2.gif\" width\u003d\"119\" /\u003e\u0026nbsp;on a line by itself. The number of stops is followed by\u0026nbsp;\u003ci\u003es\u003c/i\u003e\u0026nbsp;- 1 lines, each line\u0026nbsp;\u003ci\u003ei\u003c/i\u003e\u0026nbsp;(\u0026nbsp;\u003cimg align\u003d\"MIDDLE\" alt\u003d\"$1 \\le i \u0026lt; s$\" border\u003d\"0\" height\u003d\"31\" src\u003d\"http://uva.onlinejudge.org/external/5/507img3.gif\" width\u003d\"74\" /\u003e) is an integer\u0026nbsp;\u003cspan data-scayt_word\u003d\"ni\" data-scaytid\u003d\"2\" style\u003d\"background-color: rgb(255, 255, 255);\"\u003e\u003ci\u003en\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u003c/span\u003e\u0026nbsp;representing Jill\u0026#39;s assessment of the niceness of the road between the two stops\u0026nbsp;\u003ci\u003ei\u003c/i\u003e\u0026nbsp;and\u0026nbsp;\u003ci\u003ei\u003c/i\u003e+1.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tFor each route\u0026nbsp;\u003ci\u003er\u003c/i\u003e\u0026nbsp;in the input file, your program should identify the beginning bus stop\u0026nbsp;\u003ci\u003ei\u003c/i\u003e\u0026nbsp;and the ending bus stop\u0026nbsp;\u003ci\u003ej\u003c/i\u003e\u0026nbsp;that identify the segment of the route which yields the maximal sum of niceness, m\u003d \u003cspan data-scayt_word\u003d\"ni\" data-scaytid\u003d\"8\"\u003en\u003csub\u003ei\u003c/sub\u003e\u003c/span\u003e+\u003cspan data-scayt_word\u003d\"ni\" data-scaytid\u003d\"3\"\u003en\u003csub\u003ei\u003c/sub\u003e\u003c/span\u003e\u003csub\u003e+1\u003c/sub\u003e+...+\u003cspan data-scayt_word\u003d\"nj-1\" data-scaytid\u003d\"5\"\u003en\u003csub\u003ej-1\u003c/sub\u003e\u003c/span\u003e. If more than one segment is maximally nice, choose the one with the longest cycle ride (largest\u0026nbsp;\u003ci\u003ej\u003c/i\u003e-\u003ci\u003ei\u003c/i\u003e). To break ties in longest maximal segments, choose the segment that begins with the earliest stop (lowest\u0026nbsp;\u003ci\u003ei\u003c/i\u003e). For each route\u0026nbsp;\u003ci\u003er\u003c/i\u003e\u0026nbsp;in the input file, print a line in the form:\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003ctt\u003eThe nicest part of route\u0026nbsp;\u003c/tt\u003e\u003ci\u003er\u003c/i\u003e\u003ctt\u003e\u0026nbsp;is between stops\u0026nbsp;\u003c/tt\u003e\u003ci\u003ei\u003c/i\u003e\u003ctt\u003e\u0026nbsp;and\u0026nbsp;\u003c/tt\u003e\u003ci\u003ej\u003c/i\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tHowever, if the maximal sum is not positive, your program should print:\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003ctt\u003eRoute\u0026nbsp;\u003c/tt\u003e\u003ci\u003er\u003c/i\u003e\u003ctt\u003e\u0026nbsp;has no nice parts\u003c/tt\u003e\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\n3\r\n3\r\n -1\r\n 6\r\n10\r\n 4\r\n -5\r\n 4\r\n -3\r\n 4\r\n 4\r\n -4\r\n 4\r\n -5\r\n4\r\n -2\r\n -3\r\n -4\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\nThe nicest part of route 1 is between stops 2 and 3\r\nThe nicest part of route 2 is between stops 3 and 9\r\nRoute 3 has no nice parts\u003c/pre\u003e"}}]}