{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cimg src\u003d\"CDN_BASE_URL/491a78d59a3c23bd73dc46db14e25039?v\u003d1713691591\" border\u003d\"0\" alt\u003d\"Problem illustration\" align\u003d\"LEFT\" class\u003d\"problem_laimage\"\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eis an infinite sequence of integers that satisfies to Fibonacci condition \u003ci\u003eF\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u0026nbsp;+\u0026nbsp;2\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;\u003ci\u003eF\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u0026nbsp;+\u0026nbsp;1\u003c/sub\u003e\u0026nbsp;+\u0026nbsp;\u003ci\u003eF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e for any integer \u003ci\u003ei\u003c/i\u003e.\r\nWrite a program, which calculates the value of \u003ci\u003eF\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e for the given values of \u003ci\u003eF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and \u003ci\u003eF\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e.\u003c/div\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe input contains five integers in the following order: \u003ci\u003ei\u003c/i\u003e, \u003ci\u003eF\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003eF\u003csub\u003ej\u003c/sub\u003e\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e.\u003cbr\u003e\r\n−1000 ≤ \u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e ≤ 1000, \u003ci\u003ei\u003c/i\u003e\u0026nbsp;≠\u0026nbsp;\u003ci\u003ej\u003c/i\u003e,\u003cbr\u003e\r\n−2·10\u003csup\u003e9\u003c/sup\u003e ≤ \u003ci\u003eF\u003csub\u003ek\u003c/sub\u003e\u003c/i\u003e ≤ 2·10\u003csup\u003e9\u003c/sup\u003e (\u003ci\u003ek\u003c/i\u003e\u0026nbsp;\u003d\u0026nbsp;min(\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e), …, max(\u003ci\u003ei\u003c/i\u003e, \u003ci\u003ej\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e)).\u003c/div\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThe output consists of a single integer, which is the value of \u003ci\u003eF\u003csub\u003en\u003c/sub\u003e\u003c/i\u003e.\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\u003e3 5 -1 4 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e12\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Notes","value":{"format":"HTML","content":"\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eIn the example you are given: \u003ci\u003eF\u003c/i\u003e\u003csub\u003e3\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;5, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e−1\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;4; you asked to find the value of \u003ci\u003eF\u003c/i\u003e\u003csub\u003e5\u003c/sub\u003e. The following Fibonacci sequence can be reconstructed using known values:\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_center\"\u003e…, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e−1\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;4, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e0\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;−1, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;3, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;2, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e3\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;5, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e4\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;7, \u003ci\u003eF\u003c/i\u003e\u003csub\u003e5\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;12, …\u003c/div\u003e\u003c/div\u003e\u003cdiv class\u003d\"problem_par\"\u003e\u003cdiv class\u003d\"problem_par_normal\"\u003eThus, the answer is: \u003ci\u003eF\u003c/i\u003e\u003csub\u003e5\u003c/sub\u003e\u0026nbsp;\u003d\u0026nbsp;12.\u003c/div\u003e\u003c/div\u003e"}}]}