# 博客

## Problem B

2018-08-09 20:12:07 By hszxoizjn

$F_n~=~s_{n~-~1}\times F_{n~-~1}~+~s_{n~-~2}\times F_{n~-~2}$

$F_0~=~0,~F_1~=~1$

s = (5,3,8,11,5,3,7,11,5,3,8,11,…)

Input

Output

Sample Input

10 8

3

1 2 1

2

7 3

5 4

Sample Output

4

## 评论

Acceptor
@hszxoizjn 您是怎么搞出来滴啊
15632869526

hzoi2017_djw
In the first line there is two numbers $N$ and $Q$. Then in the second line there are $N$ numbers:$a[1]..a[N]$ In the next $Q$ lines,there are two numbers $L,R$ in each line. $N \leq 1000, Q \leq 100000, L \leq R, 1 \leq a[i] \leq 2^{31}-1$
hzoi2017_djw
Dylans is given $N$ numbers $a[1]....a[N]$ And there are $Q$ questions. Each question is like this $(L,R)$ his goal is to find the “inversions” from number $L$ to number $R$. more formally,his needs to find the numbers of pair（$x,y$）, that $L \leq x,y \leq R$ and $x < y$ and $a[x] > a[y]$
VivianWhite

Jumbo
$1\leq i\leq j<k\leq length(S)$
VivianWhite

VivianWhite