HAPPY EMPLOYEE SOLUTIONS MAKEHAPP

HAPPY EMPLOYEE SOLUTION

Who doesn’t care for compensation climbs? In content, the freshers work for nothing during their preparation period. Be that as it may, presently since their preparation period is finished and since it is content the guidelines here are very unusual. All workers here don’t get pay climbs, rather it relies upon the HR who arbitrarily chooses a few representatives and expands their compensation. 

There are N number of freshers and their underlying pay is 0. The HR doesn’t build the pay of every one of his representatives immediately rather chooses a gathering. 

At a given time, he arbitrarily chooses a coterminous gathering of workers from N depicted by l and r and expands their compensation by esteem V. Subsequently the workers in scope of l and r, both comprehensive, get compensation climb and are glad. Different workers not in extend between l to r get no climb. 

The HR builds the pay just for Q number of times. So after Q opeartions, answer the complete compensation of the apparent multitude of workers. 

 

Information: 

The principal line comprises of a solitary number T indicating the quantity of experiments. The principal line of each experiment comprises of two whole numbers N and Q. At that point Q lines follows: – Three number numbers l, r, V 

 

Yield: 

For each experiment print a solitary number – the whole of pay of all workers after Q increases. 

 

Limitations 

1≤T≤1000 

2≤N,Q,l,r,V≤109 

 

Test Input: 

3 1 

0 2 1 

 

Test Output: 

3

 
DOWNLOAD THE SOLUTION

Leave a Comment