两个吃奶一个添下面视频_人妻第一页香蕉网_欧美xxxx少妇_妺妺窝人体色www婷婷

2202 問題 D: I can do it!(I)

時間限制: 2s 內(nèi)存限制: 512MB 提交: 30 解決: 1
題目描述

You have a recursive formula such as

I can do it!(I)

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
提示
零基礎(chǔ)同學(xué)可以先學(xué)習(xí)視頻課程,包含C/C++、Python、百練、藍(lán)橋杯輔導(dǎo)、算法數(shù)據(jù)結(jié)構(gòu)等課程,提供視頻講解以及配套習(xí)題,還有老師答疑,點擊這里了解課程詳情

比賽公告

訓(xùn)練賽要求同學(xué)們獨立完成,不借助任何外界資料,堅決杜絕把百度結(jié)果直接提交的同學(xué),一旦發(fā)現(xiàn)取消所有參賽資格,并上報學(xué)院相關(guān)領(lǐng)導(dǎo),請同學(xué)們誠信為本!