You have a recursive formula such as
It is easy to calculate if n is smaller than 1000. But when n comes to 109, it may be hard to calculate the answer unless you can really computing!
I think you have this ability, so just do it!
But the answer may be to large to calculate, so you can only calculate the answer mod 1e9+7.The input consists of many test cases, but no more than 5 cases.
Each case will have three lines.
There are two integers n, k in the first line. k<n≤1010, 1≤k≤100
The second line has k numbers, and the i-th number is ai. |ai|≤109
The third line has k numbers too, and the i-th number is Fi. |Fi|≤109
For each test case, you should output a number describe the answer.
83167 5 270044411 64763 389502790 165642235 3775223 136407894 699370879 998658047 184722627 -678977043 79679 3 427397619 485492671 476934139 -360282785 178718524 606397373
299168603 559548063
題號(hào):2201,2202,2203,2204,2205,2206,2207,2208,2209,2210
點(diǎn)擊上方導(dǎo)航欄的訓(xùn)練,點(diǎn)擊題庫(kù),尋找題號(hào)即可找到對(duì)應(yīng)題目,比賽結(jié)束后,請(qǐng)通過(guò)訓(xùn)練->題庫(kù)->尋找對(duì)應(yīng)題目的方式做題
因?yàn)椴淮_定因素太多,就不再安排大家輪流講題了,大家做不出題可以在測(cè)試結(jié)束后去題庫(kù)找對(duì)應(yīng)的題目看題解,希望大家自覺(jué)練習(xí),認(rèn)真練習(xí),考核測(cè)試會(huì)采取不同與現(xiàn)在測(cè)試的方式,兩個(gè)月后綜合測(cè)試成績(jī)不達(dá)標(biāo)者會(huì)退出實(shí)驗(yàn)室,希望大家認(rèn)真對(duì)待