# 一 题目

Source

## Descriptions

10^9 contestants, numbered 1 to 10^9, will compete in a competition. There will be two contests in this competition.

The organizer prepared N problems, numbered 1 to N, to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Contestant Li to Contestant Ri (inclusive), and will not be solved by any other contestants.

The organizer will use these N problems in the two contests. Each problem must be used in exactly one of the contests, and each contest must have at least one problem.

The joyfulness of each contest is the number of contestants who will solve all the problems in the contest. Find the maximum possible total joyfulness of the two contests.

## Input

Input is given from Standard Input in the following format:

## Output

Print the maximum possible total joyfulness of the two contests.

# 二 题解

$$- - - - \mathcal{End} - - - -$$