{"trustable":true,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eXXX always procrastinate over his homework. This time, he is wondering that if he can finish all his projects before deadline. There are n (2\u0026lt;\u003dn\u0026lt;\u003d5) projects to do. Each projects has a deadline d (1\u0026lt;\u003dd\u0026lt;\u003d1000) which means that this project must be finished no later than d o\u0027clock.\u003cbr\u003eFor each project, there is an interval [s1, s2] (1\u0026lt;\u003ds1\u0026lt;\u003ds2\u0026lt;\u003d200) meaning that XXX will spend at least s1 hours and at most s2 hours to finish it. \u003cbr\u003eLet random variable t denotes that it takes t hours to finish the project. (Note that t may take real values). \u003cbr\u003eIf s1\u0026lt;s2, variable t obeys a continuous uniform distribution. Its probability density function is:\u003cbr\u003e\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/659aeaccaa1b85470702d9e186505698?v\u003d1726320781\"\u003e\u003c/center\u003e \u003cbr\u003e\u003cbr\u003eIf s1\u003ds2, variable t takes constant value s1.\u003cbr\u003eIn probability theory, a probability density function (pdf), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. The probability for the random variable to fall within a particular region is given by the integral of this variable’s density over the region. The probability density function is nonnegative everywhere, and its integral over the entire space is equal to one.\u003cbr\u003eXXX cannot engage in different projects at the same time. He wants to arrange the order of his projects to be done properly, so that the probability that all projects are finished before or just meet the deadline is maximized.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"There are no more than 3000 cases. \u003cbr\u003eFor each case, the first line begins with an integer n --- the number of projects. \u003cbr\u003eEach of the following n lines describes one project which contains three integers --- the above mentioned s1, s2 and d. \u003cbr\u003eThe input ends by n\u003d0."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output the answer in one line. \u003cbr\u003eIf the probability is 0, then output “Poor boy!” without quotes.\u003cbr\u003eIf the probability is 1, then output “Congratulations!” without quotes. \u003cbr\u003eIf the probability is between 0 and 1 exclusive, then output a fraction to represent the probability. The numerator and the denominator should be positive and co-prime.\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\u003e2\r\n1 1 3\r\n1 3 3\r\n2\r\n1 1 3\r\n2 2 2\r\n0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1/2\r\nCongratulations!\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}