{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\nWatashi loves M mm very much.\nOne day, M mm gives Watashi a chance to choose a number between \u003ci\u003elow\u003c/i\u003e and \u003ci\u003ehigh\u003c/i\u003e, and if the choosen number is lucky, M mm will marry him.\n\u003c/p\u003e\n\n\u003cp\u003e\nM mm has 2 sequences, the first one is BLN (Basic Lucky Numbers), and the second one is BUN (Basic Unlucky Numbers).\nShe says that a number is lucky if it\u0027s divisible by at least one number from BLN and not divisible by at least one number from BUN.\n\u003c/p\u003e\n\n\u003cp\u003e\nObviously, Watashi doesn\u0027t know the numbers in these 2 sequences, and he asks M mm that how many lucky number are there in [\u003ci\u003elow\u003c/i\u003e, \u003ci\u003ehigh\u003c/i\u003e]?\n\u003c/p\u003e\n\n\u003cp\u003e\nPlease help M mm calculate it, meanwhile, tell Watashi what is the probability that M mm marries him.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nThe first line of each test case contains the numbers \u003ci\u003eN\u003csub\u003eBLN\u003c/sub\u003e\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003eN\u003csub\u003eBLN\u003c/sub\u003e\u003c/i\u003e \u0026lt;\u003d 15), \u003ci\u003eN\u003csub\u003eBUN\u003c/sub\u003e\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003eN\u003csub\u003eBUN\u003c/sub\u003e\u003c/i\u003e \u0026lt;\u003d 500), \u003ci\u003elow\u003c/i\u003e, \u003ci\u003ehigh\u003c/i\u003e (1 \u0026lt;\u003d \u003ci\u003elow\u003c/i\u003e \u0026lt;\u003d \u003ci\u003ehigh\u003c/i\u003e \u0026lt;\u003d 10\u003csup\u003e18\u003c/sup\u003e).\n\u003c/p\u003e\n\n\u003cp\u003e\nThe second and third line contain \u003ci\u003eN\u003csub\u003eBLN\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003eN\u003csub\u003eBUN\u003c/sub\u003e\u003c/i\u003e integers, respectively.\nEach integer in sequences BLN and BUN is from interval [1, 32767].\n\u003c/p\u003e\n\n\u003cp\u003e\nThe last test case is followed by four zero.\n\u003c/p\u003e\n\n\u003cp\u003e\nThe input will contain no more than 50 test cases.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nFor each test case output one number, the number of lucky number between \u003ci\u003elow\u003c/i\u003e and \u003ci\u003ehigh\u003c/i\u003e.\n\u003c/p\u003e\n\n\u003cp\u003e\u003cb\u003eSample Input\u003c/b\u003e\u003c/p\u003e\n\n\u003cpre\u003e2 1 70 81\n2 3\n5\n0 0 0 0\n\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eSample Output\u003c/b\u003e\u003c/p\u003e\n\u003cpre\u003e5\n\u003c/pre\u003e\n\n\u003cp\u003e\u003cb\u003eHint\u003c/b\u003e\u003c/p\u003e\n\n\u003cp\u003e\nThe lucky numbers in the sample are 72, 74, 76, 78, 81.\n\u003c/p\u003e"}}]}