Problems

# Olympiad

# Olympiad

**n** teams arrived to the Informatics Olympiad. Each team consists of `a`

boys and _{i}`b`

girls (_{i}**1** ≤ **i** ≤ **n**). The participants can live in rooms with **m** places in each. Find the minimum number of rooms needed to accommodate all the Olympiad participants, if the boys can't be settled with the girls.

#### Input

The first line contains the values of **n** and **m**. In the next **n** lines the pairs of numbers `a`

, _{i}`b`

(_{i}**1** ≤ **i** ≤ **n**) are given. All numbers are positive integers not greater than **100**.

#### Output

Print the minimum required number of rooms.

Input example #1

2 3 2 1 3 2

Output example #1

3