Problem1247--#515. 「LibreOJ β Round #2」贪心只能过样例

1247: #515. 「LibreOJ β Round #2」贪心只能过样例

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

一共有 $n$ 个数,第 $i$ 个数 $x_i$ 可以取 $[a_i , b_i]$ 中任意值。
设 $S = \sum{{x_i}^2}$,求 $S$ 种类数。

Input

第一行一个数 $n$。
然后 $n$ 行,每行两个数表示 $a_i,b_i$。

Output

输出一行一个数表示答案。

Constraints

$1 \le n , a_i , b_i \le 100$

Sample 1 Input

5
1 2
2 3
3 4
4 5
5 6

Sample 1 Output

26

Source/Category