Autobahn

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

There are NN people testing their racing cars on notorious autobahn where limits do not exist. In this task however limits do exist. So we kindly ask you to restrain yourself from submitting exponential complexity solutions.

Person ii came to autobahn at the beginning of minute l_il\_i, paid for t_it\_i minutes of stay and left at the end of minute r_ir\_i. Unfortunately some stayed for longer than that they have paid for. Administration of autobahn decided not to be very harsh and charge them only for those extra minutes in which there were at least KK people on autobahn.

In a rush of generosity, administration decided to introduce happy hour i.e. interval of continuous XX minutes for which they won’t be paying extra charges. They picked happy hour so that the sum of extra charges that won’t be paid is maximal possible. Determine that sum.

입력

First line contains integers NN, KK and XX (KNK \le N) from task description.

Next NN lines contain integers l_il\_i, t_it\_i and r_ir\_i (l_ir_il\_i \le r\_i) from task description.

출력

Print the required sum in a single line.

힌트

First sample explanation: Happy hour will span from 4th until the 7th minute. Inside that interval, first person should’ve paid extra for the 4th minute and second, third and fourth person should’ve paid for 6th and 7th minute.