Dr. S. De teaches computer architecture in NIT Patna. 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 semester he assigns 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 student. He is busy in improving his finger print attendance module, can you help him?
Input file may be large so try to use fast input output

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase contains of a 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 contains 3 integers -$i, j, k$ i.e. starting roll number, end roll number and complexity of the question

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

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N, M \leq 10^5$
- $1 \leq i \leq j \leq N$
- $1 \leq k \leq 100$

-----Subtasks-----
Subtask1 
- 
$1 \leq T \leq 10$
- 
$1 \leq N, M \leq 10^4$
Subtask2
- 
Original Constraints 

-----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$

Difficulty: interview

Starter code:

Solutions:
try:
 t=int(input())
 for a in range(t):
  l=input().split()
  n=int(l[0])
  m=int(l[1])
  d={}
  s=0
  for b in range(m):
   l1=input().split()
   i=int(l1[0])
   j=int(l1[1])
   k=int(l1[2])
   for c in range(i,j+1):
    if c not in d:
     d[c]=10
   for c in range(i,j+1):
    d[c]=d[c]*k
  for i in d:
   s=s+d[i]
  print(s//n)
except:
 pass

for _ in range(int(input())):
 n, m = map(int, input().split())

 s = [1] * n + [0]

 for _ in range(m):
  i, j, k = map(int, input().split())

  s[i-1] *= k
  s[j] /= k

 for i in range(1, n):
  s[i] *= s[i-1]

 print(int(sum(s) * 10 // n))

# cook your dish here
T = int(input())
for i in range(T):
 N,M = map(int,input().split())
 lis = [10]*N
 for z in range(M):
  i,j,k = map(int,input().split())
  for y in range(i-1,j):
   lis[y] *= k
 tot = 0
 for i in lis:
  tot += i
 print(int(tot/N))

from sys import stdin,stdout


T=int(stdin.readline().strip())

for _ in range(T):
 n,m=stdin.readline().strip().split(' ')
 n,m=int(n),int(m)
 mast=[[[],[]] for i in range(n)]
 for hola in range(m):
  i,j,k=stdin.readline().strip().split(' ')
  i,j,k=int(i),int(j),int(k);i-=1;j-=1;
  mast[i][0].append(k)
  if j+1<n:
   mast[j+1][1].append(k)



 tot=0
 ini=10




 for i in mast:
  
  for j in i[0]:
   ini*=j
  for j in i[1]:
   ini=ini//j
  tot+=ini
  
 tot=tot//n





 stdout.write(str(tot)+"\n")



try:
 for _ in range(int(input())):
  n,m=map(int,input().split())
  l=[10]*n
  for i in range(m):
   s,e,v=map(int,input().split())
   for i in range(s-1,e):
    l[i]*=v
   #print(l)
  #print(l,"ll")
  print(sum(l)//n)
 
except:
 pas

from sys import stdin, stdout 
import numpy as np
t = int(stdin.readline())
while t>0:
 t-=1
 n,m = stdin.readline().split()
 n= int(n)
 m = int(m)
 b = [1]*(n+1)
 c = [1]*(n+1)
 b = np.asarray(b)
 c = np.asarray(c)
 while m>0:
  m-=1
  i,j,k = stdin.readline().split()
  i=int(i)
  j=int(j)
  k=int(k)
  b[i-1]*=k;
  c[j]*=k;
 ar = [10]*(n+1)
 ar = np.asarray(ar)
 ar[0] = b[0];
 ar[0]/=c[0];
 for i in range(n):
  ar[i] = ar[i-1];
  ar[i] *= b[i];
  ar[i]/= (c[i]);
 Sum=0
 for i in range(n):
  Sum+=ar[i];
 print(int(Sum/n))


for test_case in range(int(input())):
 n, m = list(map(int, input().split()))
 
 arr = [10]*n
 for i in range(m):
  i, j, k = list(map(int, input().split()))
  
  for a1 in range(i-1, j):
   arr[a1] *= k 
 
 print(sum(arr)//n)

# from sys import stdin, stdout 

# t=int(stdin.readline())
# for i in range(2):
#     n= int(stdin.readline())
#     m = int(stdin.readline())
#     print(n, m)


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


# cook your dish here
t=int(input())
for _ in range(t):
 n,m=list(map(int,input().split(" ")))
 li=[10 for i in range(n)]
 for j in range(m):
  s,e,k=list(map(int,input().split(" ")))
  for i in range(s-1,e):
   li[i]=li[i]*k
 c=0
 l=len(li)
 for i in li:
  c+=i
 print(int(c/l)) 


# cook your dish here
t=int(input())
for i in range(0,t):
 a=list(map(int,input().split()))
 m=[10]*a[0]
 
 for j in range(0,a[1]):
  b=list(map(int,input().split()))
  for k in range(b[0]-1,b[1]):
   m[k]=m[k]*b[2]
 l=sum(m)
 o=l//a[0]
 print(o)


try:
 t=int(input())
 for a in range(t):
  l=input().split()
  n=int(l[0])
  m=int(l[1])
  d={}
  s=0
  for b in range(m):
   l1=input().split()
   i=int(l1[0])
   j=int(l1[1])
   k=int(l1[2])
   for c in range(i,j+1):
    if c not in d:
     d[c]=10
   for c in range(i,j+1):
    d[c]=d[c]*k
  for i in d:
   s=s+d[i]
  print(s//n)
except:
 pass

t=int(input())
while(t!=0):
 n,m=map(int,input().split(" "))
 l=[10]*(n)
 for i in range(m):
  l1,r,p=map(int,input().split(" "))
  for k in range(l1-1,r):
   l[k]=l[k]*p
 print(sum(l)//len(l))
 t-=1

for t in range(int(input())):
 n,m=list(map(int,input().split()))
 x=[]
 for i in range(n):
  x.append(10)
 for i in range(m):
  i,j,k=list(map(int,input().split()))
  for j in range(i-1,j):
   x[j]*=k
 s=0
 for i in range(n):
  s+=x[i]
 print(int(s/n))
  
 


try:
 for _ in range(int(input())):
  n,m=map(int,input().split())
  l=[10]*n
  for i in range(m):
   s,e,v=map(int,input().split())
   for i in range(s-1,e):
    l[i]*=v
   #print(l)
  #print(l,"ll")
  print(sum(l)//n)
 
except:
 pass

from sys import stdin, stdout 
t = int(stdin.readline())
while t>0:
 t-=1
 n,m = stdin.readline().split()
 n= int(n)
 m = int(m)
 b = [1]*(n+1)
 c = [1]*(n+1)
 

 while m>0:
  m-=1
  i,j,k = stdin.readline().split()
  i=int(i)
  j=int(j)
  k=int(k)
  b[i-1]*=k;
  c[j]*=k;
 ar = [10]*(n+1)
 ar[0] = b[0];
 ar[0]/=c[0];
 for i in range(n):
  ar[i] = ar[i-1];
  ar[i] *= b[i];
  ar[i]/= (c[i]);
 Sum = 0
 for i in range(n):
  Sum+=ar[i];
 print(int(Sum/n))


try:
 for _ in range(int(input())):
  n,m=map(int,input().split())
  l=[10]*n
  for i in range(m):
   s,e,v=map(int,input().split())
   for i in range(s-1,e):
    l[i]*=v
   #print(l)
  #print(l,"ll")
  print(sum(l)//n)
 
except:
 pass

# cook your dish here
t=int(input())
for i in range(0,t):
 a=list(map(int,input().split()))
 m=[10]*a[0]
 
 for j in range(0,a[1]):
  b=list(map(int,input().split()))
  for k in range(b[0]-1,b[1]):
   m[k]=m[k]*b[2]
 l=sum(m)
 o=l//a[0]
 print(o)


# cook your dish here
t=int(input())
for i in range(0,t):
 a=list(map(int,input().split()))
 m=[10]*a[0]
 
 for j in range(0,a[1]):
  b=list(map(int,input().split()))
  for k in range(b[0]-1,b[1]):
   m[k]=m[k]*b[2]
 l=sum(m)
 print(l//a[0])


# cook your dish here
import math as ma

N=int(input())
for h in range(N):
 l=list(map(int,input().split()))
 n,q=l
 s=[10]; s=s*n

 for ques in range(q):
  l=list(map(int,input().split()))
  i,j,k=l
  for p in range(i-1,j):
   s[p]=s[p]*k
 print(ma.floor(sum(s)/n))

  
 


t = int(input())
while t>0:
 t-=1
 n,m = input().split()
 n= int(n)
 m = int(m)
 b = [1]*(n+1)
 c = [1]*(n+1)
 

 while m>0:
  m-=1
  i,j,k = input().split()
  i=int(i)
  j=int(j)
  k=int(k)
  b[i-1]*=k;
  c[j]*=k;
 ar = [10]*(n+1)
 ar[0] = b[0];
 ar[0]/=c[0];
 for i in range(n):
  ar[i] = ar[i-1];
  ar[i] *= b[i];
  ar[i]/= (c[i]);
 Sum = 0
 for i in range(n):
  Sum+=ar[i];
 print(int(Sum/n))


import sys
for _ in range(int(input())):
 n, m = sys.stdin.readline().split()
 score = []
 for x in range(int(n)):
  score.append(10)
 for x in range(int(m)):
  i, j , k = sys.stdin.readline().split()
  i = int(i)
  j = int(j)
  k = int(k)
  for x in range(i-1, j):
   score[x] = score[x]*int(k)
 print(sum(score)//int(n))

t=int(input())

for i in range(t):
 N,M=map(int,input().split())
 lis=[]
 for i in range(N):
  lis.append(10)
 
 for i in range(M):
  a,b,c=map(int,input().split())
  for i in range(a-1,b):
   lis[i]=lis[i]*c
 print(sum(lis)//N)

import math

for _ in range(int(input())):
 n,m=list(map(int,input().split()))
 a=[10 for _ in range(n)]
 mul=[1 for _ in range(n)]
 for i in range(m):
  s,e,t=list(map(int,input().split()))
  s=s-1
  e=e-1
  for j in range(s,e+1):
   mul[j]*=t
 res=sum(mul)/len(mul)
 res=int(math.floor(res*10))
 print(res)


from numpy import array

for _ in range(int(input())):
 n, m = map(int, input().split())

 s = array([10] * n)

 for _ in range(m):
  i, j, k = map(int, input().split())

  s[i-1:j] *= k

 print(sum(s) // n)

import sys
input = lambda: sys.stdin.readline().rstrip()
for _ in range(int(input())):
 n,m=list(map(int,input().split()))
 a=[10]*n
 for i in range(m):
  x,y,z=list(map(int,input().split()))
  for i in range(x-1,y):
   a[i]*=z
 print(sum(a)//len(a))