{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eA small group of brave magicians gathered together to kill the bad dragon.\r\nSince they do it every week (sometimes in several attempts),\r\nthey know the dragon’s behaviour by heart and can predict all his moves\r\nwith one second precision.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThere are two kinds of magicians: attackers and healers.\r\nThe purpose of attackers is to damage the dragon, and\r\nthe purpose of healers is to heal injured magicians.\r\nEach attacker can surround the dragon with an anti-magic aura that\r\ncontinuously damages the dragon.\r\nSimilarly, each healer can surround all magicians on the battlefield\r\nwith an aura that continuously restores their health.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eWhile a magician maintains his spell, the power of his aura \r\n(the damage or healing in a unit of time) increases linearly.\r\nBut the power of the aura of each magician can not exceed some fixed value\r\nassociated with the magician.\r\nWhile a magician does not maintain the spell, the power of his aura\r\ndecreases linearly until it falls to zero.\r\nSo the power of an aura can never become negative.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAuras of different magicians are independent and don’t influence each other.\r\nThe total damage the dragon gets equals to the sum of damages\r\nfrom every attacker’s aura.\r\nSimilarly, the total healing each magician gets equals to the sum of\r\namounts of healing from every healer’s aura.\r\nHit points of a magician can not exceed their initial value that is\r\nthe same for each magician.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eDuring the battle, the dragon uses different spells in some fixed order.\r\nThe same type of spell can be used multiple times in a row.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe first spell is Fire Storm.\r\nIt creates a wall of fire all over the field\r\nexcept for a small plot of land in the center of the storm.\r\nWhile a magician is located in the fire, he gets constant damage equal to the power\r\nof this spell and is not able to cast a spell.\r\nThere is enough space in the center of the storm to locate all magicians\r\nwithout getting damage, and there they can cast spells.\r\nThe center of the storm can appear in different places each time\r\nthis spell is used.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe second spell is Dragon’s Breath.\r\nWhile the dragon uses it, all magicians in the field\r\nget constant damage equal to the power of this spell.\r\nFortunately, there are some \u003ci\u003e relatively safe\u003c/i\u003e locations, where\r\nmagicians can cast their spells (in the other points magicians can not do this).\r\nHowever, such locations are too small, and at each of them,\r\nthere is room for only one magician.\r\nThe number of such locations always equals to the number of magicians.\r\nSimilar to the Fire Storm, relatively safe locations can appear\r\nin different places each time.\r\nSince Dragon’s Breath takes much magic power,\r\nthe dragon never uses it more than two times in a row.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAfter a while, the dragon gets tired of the battle and strikes\r\nall magicians with his tail, instantly killing them.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAn \u003ci\u003e attack\u003c/i\u003e of the dragon is either using one of his two spells or\r\nhis tail strike. The first attack starts at time 0.\r\nEach subsequent attack starts at the time the previous attack is finished.\r\nAt the very moment when the dragon switches two attacks, the first of them\r\nis considered to have effect.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eMagicians don’t like to be fried, so each of them runs to the center\r\nof the fire storm along a straight line right after it starts.\r\nIn case of Dragon’s Breath, each magician chooses one of the relatively safe\r\nlocations for himself and runs straight to that location.\r\nSeveral magicians can run through the same point \r\nat the same time.\r\nHowever, it doesn’t deny the fact that each relatively safe location\r\ncan be considered only for exactly one magician.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe dragon does not like to hurry, so the duration of his spells\r\nis long enough for all magicians to reach every safe location\r\nof the current spell from every safe location of the previous spell\r\nregardless of which magicians go to which safe locations.\r\n(Note however that there is \u003ci\u003eno\u003c/i\u003e guarantee that they can get\r\nto their destinations alive.)\r\nMoreover, if the current spell is Fire Storm, then its duration is long enough\r\nnot only to reach its center but also to increase the power of all attacking\r\nand healing auras to maximum value and to totally restore all magicians’\r\nhealth regardless of how much health they had.\r\nDragon’s spells can have different power but it is always\r\nstrictly greater than the maximal total power of all healing auras.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf at some moment hit points of any magician fall to zero,\r\nall magicians die. Killing the dragon is slightly more complicated\r\nthan killing a magician. It is necessary not only to make his hit\r\npoints equal to zero but also to cast a final spell.\r\nCasting the final spell requires all magicians to gather at the center\r\nof the fire storm. Obviously, magicians must be alive to cast the final spell.\r\nThe final spell can be cast instantly.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAt time 0, all magicians are located at the origin, the power of every\r\nhealer’s aura is equal to its maximal level, and the power of \r\nevery attacker’s aura is equal to zero.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIn the first line of input, you are given three nonnegative integers\r\n\u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e and \u003ci\u003ek\u003c/i\u003e: the number of attackers, the number of healers\r\nand the total number of dragon’s attacks\r\n(1 ≤ \u003ci\u003en\u003c/i\u003e, \u003ci\u003em\u003c/i\u003e ≤ 9; \u003ci\u003en\u003c/i\u003e + \u003ci\u003em\u003c/i\u003e ≤ 10; 1 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 10).\r\nIn the second line, there are three integers \u003ci\u003ehp\u003c/i\u003e\u003csub\u003e\u003ci\u003em\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ev\u003c/i\u003e and \u003ci\u003ehp\u003c/i\u003e\u003csub\u003e\u003ci\u003ed\u003c/i\u003e\u003c/sub\u003e:\r\ninitial hit points and velocity of each magician and initial hit points of the dragon\r\n(1 ≤ \u003ci\u003ehp\u003c/i\u003e\u003csub\u003e\u003ci\u003em\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ehp\u003c/i\u003e\u003csub\u003e\u003ci\u003ed\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e; 1 ≤ \u003ci\u003ev\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe next \u003ci\u003en\u003c/i\u003e lines describe attackers.\r\nOn \u003ci\u003ei\u003c/i\u003e-th of them, there are three integers \u003ci\u003edps\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003eid\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e and \u003ci\u003edd\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e:\r\nthe maximal power of \u003ci\u003ei\u003c/i\u003e-th attacker’s aura,\r\nthe increment of the power of his aura per unit of time while he\r\nmaintains the spell, and decrement of the power of his aura per unit of time while\r\nhe runs to the next safe location\r\n(1 ≤ \u003ci\u003edps\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003eid\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003edd\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe next \u003ci\u003em\u003c/i\u003e lines describe healers.\r\nOn \u003ci\u003ei\u003c/i\u003e-th of them, there are three integers \u003ci\u003ehps\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003eih\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e and \u003ci\u003edh\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\r\ndescribing the same values that were described by numbers \u003ci\u003edps\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003eid\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\r\nand \u003ci\u003edd\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e for attackers.\r\n(1 ≤ \u003ci\u003ehps\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003eih\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003edh\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eAfter that, there are \u003ci\u003ek\u003c/i\u003e blocks which describe dragon’s attacks in\r\nchronological order.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf the attack is a Fire Storm, the first line of the block\r\ncontains a single word “Storm”.\r\nOn the second line of the block, you are given space-separated integers \u003ci\u003ed\u003c/i\u003e and \u003ci\u003et\u003c/i\u003e:\r\nthe power and duration of the spell (1 ≤ \u003ci\u003ed\u003c/i\u003e, \u003ci\u003et\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\r\nOn the third line of the block, there are two integers \u003ci\u003ex\u003c/i\u003e and \u003ci\u003ey\u003c/i\u003e:\r\ncoordinates of the center of this storm\r\n(−1000 ≤ \u003ci\u003ex\u003c/i\u003e, \u003ci\u003ey\u003c/i\u003e ≤ 1000).\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf the attack is a Dragon’s Breath, the first line of the block contains\r\na single word “Breath”.\r\nOn the second line of the block, you are given space-separated integers \u003ci\u003ed\u003c/i\u003e and \u003ci\u003et\u003c/i\u003e:\r\nthe power and duration of the spell (1 ≤ \u003ci\u003ed\u003c/i\u003e, \u003ci\u003et\u003c/i\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\r\nThe next \u003ci\u003en\u003c/i\u003e + \u003ci\u003em\u003c/i\u003e lines of the block contains two integers each \u003ci\u003ex\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e and \u003ci\u003ey\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e:\r\ncoordinates of relatively safe locations.\r\nAll relatively safe locations are different.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf the attack is a Tail Strike, its description is \r\na single word “Tail”.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIt is guaranteed that among all attacks, there is exactly one Tail Strike\r\nand this attack is the last one.\r\nIt is also guaranteed that there can not be more than two\r\nDragon’s Breaths in a row.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eDurations of spells are given in seconds, coordinates are in meters,\r\nvelocities are in meters per second. Powers of magicians’ auras and \r\npowers of the dragon spells are given in hit points per second,\r\nthe increment and the decrement of powers of auras are \r\nin hit points per square second.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eNote that, although the given values are all integers,\r\nall movement, damage, healing and changes in aura powers happen continuously.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIf the magicians are not able to kill the dragon, output a single line\r\n“You are not prepared”.\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eOtherwise, on the first line, output “No useful loot again”.\r\nOn the second line, output one integer: the minimal number of attack\r\nduring which the dragon can die.\r\nAttacks are numbered from 1.\u003c/div\u003e\u003c/div\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\u003e1 1 2\r\n1 5 10\r\n1 3 2\r\n1 1 1\r\nStorm\r\n7 11\r\n0 0\r\nTail\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNo useful loot again\r\n1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\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\u003e1 1 2\r\n1 5 10\r\n1 3 2\r\n1 1 1\r\nStorm\r\n7 10\r\n0 0\r\nTail\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYou are not prepared\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}