搬运NFLS训练
NFLS Programming Training 2019-9-19

For international readers, please scroll down.

A - 求和(sum.cpp)

Statement

的第q项到p项的和。

Input

n k q p

Output

一个整数,取模

Example

In:
2 0 2 3
Out:
12

Constriants

For 100%:

B - 倍数(multiple.cpp)

Statement

求一个数n的倍数中二进制下1的最小个数。多测

Input

T
n1
n2
...
nT

Output

T行。

Example

In:
3
4
7
11
Out:
1
3
2
Explain:

Constriants

For 40%:
For 70%:
For 100%:

C - 火星语 (opal.cpp)

Statement

表达式计算。
定义 (a,b)=(a+b)%10000
定义 [a,b]=(a<b?0:9999)
定义 {a?b:c}=(a%2==1?b:c)
求表达式的值。

Input

s

Output

一个整数

Example

In:
{[4,3]?(1,2):7}
Out:
3

Constriants

Subtask 1: 只有()
Subtask 2: 只有()[]
Subtask 3:

English Version

A - Sum

Statement

Find the sum of the q-th term to the p-th term of

Input

n k q p

Output

One integer, module 1e9+7

Example

In:
2 0 2 3
Out:
12

Constriants

For 100%:

B - Multiple

Statement

Find the minimal digit '1' in the multiple of the given integer N. You need to solve the question T times.

Input

T
n1
n2
...
nT

Output

T lines.

Example

In:
3
4
7
11
Out:
1
3
2
Explain:

Constriants

For 40%:
For 70%:
For 100%:

C - Opal

Statement

Define (a,b)=(a+b)%10000
Define [a,b]=(a<b?0:9999)
Define {a?b:c}=(a%2==1?b:c)
Find the value of a given expression s.

Input

s

Output

One integer

Example

In:
{[4,3]?(1,2):7}
Out:
3

Constriants

Subtask 1: S contains operation () only
Subtask 2: S contains operation () and [] only
Subtask 3: