n teams arrived to the Informatics Olympiad. Each team consists of ai boys and bi girls. 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.
The first line contains the values of n and m. In the next n lines the pairs of numbers ai,bi (1≤i≤n) are given. All numbers are positive integers not greater than 100.
Print the minimum required number of rooms.