Benny and Functions

0

0 votes
Data Structures, Medium, Approved
Problem

Benny likes functions.

Initially, she has an array P consisting of n elements with indices from 0 to n1. All the elements of the array are zeroes.

In this problem, she asks you to help her proceed some queries.

Each query looks like: t l r p. You have to make Pi=Pi+Ft(il,p) for all i from l to r.

There are several types of functions.

  • List item F1(x,p)=ln(x+1)p, where 0p1337 and p is integer.
  • List item F2(x,p)=xp, where p0.25,0.35,0.5,1,2,3
  • List item F3(x,p)=px+1, where 0p1337 and p is integer.

Input format

The first line contains two integers: n and m.

The next m lines contain four integers t, l, r, p

Constraints

1n,m105
0lr<n
1t3

Output format

Output the result array P, each number with at least 6 digits after decimal point.

Scoring

Let Q be correct answer and P is the output produced by participant. Then the score is: 1000ln[max(maxiei,1010)], where ei is an error for i-th number, which is computed as ei=|PiQi|max(1,Qi).

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?