#P1424. 小鱼的航程(改进版)

小鱼的航程(改进版)

The Little Fish's Journey (Improved Version)

Problem Source

Luogu P1424

Problem Description

There is a little fish that swims 250250 kilometres every weekday and rests on weekends (a two-day weekend). Starting from week day xx and counting nn days ahead, how many kilometres will the little fish have swum in total?

Input Format

The input consists of two positive integers x,nx, n: nn days are counted starting from week day xx.

Output Format

Print one integer: the total distance the little fish has swum, in kilometres.

Sample Input

3 10

Sample Output

2000

Hint

The data guarantees 1≤x≤71\le x \le 7 and 1≤n≤1061 \le n\le 10^6.