Prof. Sergio Marquina is a mathematics teacher at the University of Spain. Whenever he comes across any good question(with complexity k), he gives that question to students within roll number range i and j.
At the start of the semester he assigns a score of 10 to every student in his class if a student submits a question of complexity k, his score gets multiplied by k.
This month he gave M questions and he is wondering what will be mean of maximum scores of all the students. He is busy planning a tour of the Bank of Spain for his students, can you help him?

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains the first line of input, two integers N, M i.e. Number of students in the class and number of questions given in this month.
- Next M lines contain 3 integers -i,j,k i.e. starting roll number, end roll number, and complexity of the question

-----Output:-----
- For each test case, output in a single line answer - floor value of Mean of the maximum possible score for all students.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N, M \leq 105$
- $1 \leq i \leq j \leq N$
- $1 \leq k \leq 100$

-----Sample Input:-----
1
5 3
1 3 5
2 5 2
3 4 7

-----Sample Output:-----
202

-----EXPLANATION:-----
Initial score of students will be : [10,10,10,10,10]
after solving question 1 scores will be: [50,50,50,10,10]
after solving question 2 scores will be: [50,100,100,20,20]
after solving question 1 scores will be: [50,100,700,140,20]
Hence after all questions mean of maximum scores will (50+100+700+140+20)/5=202

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
for t in range(int(input())):
	(n, m) = [int(x) for x in input().rstrip().split()]
	s = []
	for p in range(n):
		s.append(10)
	for c in range(m):
		(i, j, k) = [int(x) for x in input().rstrip().split()]
		for q in range(i - 1, j):
			s[q] = s[q] * k
	print(sum(s) // n)


import math
for _ in range(int(input())):
	(n, m) = list(map(int, input().split()))
	p = [10] * n
	for i in range(m):
		l = list(map(int, input().split()))
		i = l[0] - 1
		j = l[1]
		k = l[2]
		for s in range(i, j, 1):
			p[s] = p[s] * k
	sup = sum(p)
	sup = math.floor(sup / n)
	print(sup)


t = int(input())
for _ in range(t):
	(n, m) = map(int, input().split())
	a = list()
	for _ in range(n):
		a.append(10)
	for _ in range(m):
		(i, j, k) = map(int, input().split())
		for z in range(i - 1, j):
			a[z] = a[z] * k
print(sum(a) // n)


import numpy as py
T = int(input())
for _ in range(T):
	(N, M) = list(map(int, input().split()))
	l = [10] * N
	for _ in range(M):
		(i, j, k) = list(map(int, input().split()))
		s1 = l[:i - 1]
		s2 = l[i - 1:j]
		s3 = l[j:]
		new = list(py.array(s2) * k)
		l = s1 + new + s3
s = sum(l) // N
print(s)