message
stringlengths
2
433k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
113
108k
cluster
float64
12
12
__index_level_0__
int64
226
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,646
12
99,292
Tags: dp Correct Solution: ``` n=int(input()) a=list(map(int,input().split())) dp=[[0,0] for i in range(201)] for i in range(201): dp[i][1]=1 mod=998244353 for i in range(1,n+1): dp1=[[0,0] for _ in range(201)] for j in range(1, 201): if a[i - 1] == -1 or a[i - 1] == j: dp1[j][0] = (dp1[...
output
1
49,646
12
99,293
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,647
12
99,294
Tags: dp Correct Solution: ``` import os from io import BytesIO from math import trunc if os.name == 'nt': input = BytesIO(os.read(0, os.fstat(0).st_size)).readline MX = 201 MOD = 998244353 MODF = float(MOD) MODF_inv = 1.0 / MODF quickmod1 = lambda x: x - MODF * trunc(x / MODF) def quickmod(a): return a - ...
output
1
49,647
12
99,295
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,649
12
99,298
Tags: dp Correct Solution: ``` import os from io import BytesIO from math import trunc input = BytesIO(os.read(0, os.fstat(0).st_size)).readline MOD = 998244353 MODF = float(MOD) MAGIC = 6755399441055744.0 SHRT = 65536.0 MODF_INV = 1.0 / MODF SHRT_INV = 1.0 / SHRT fround = lambda x: (x + MAGIC) - MAGIC fmod = lamb...
output
1
49,649
12
99,299
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,650
12
99,300
Tags: dp Correct Solution: ``` from math import trunc MX = 201 MOD = 998244353 MODF = MOD * 1.0 quickmod = lambda x: x - MODF * trunc(x / MODF) def main(): n = int(input()) a = map(int, input().split()) dp0 = [1.0] * MX dp1 = [0.0] * MX for x in a: pomdp0 = [0.0] * MX pomdp1 = ...
output
1
49,650
12
99,301
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,651
12
99,302
Tags: dp Correct Solution: ``` MOD = 998244353.0 float_prec = 1801439850948198.4 float_mod = lambda x: x if -float_prec < x < float_prec else x % MOD n = int(input()) a = [int(i) for i in input().split()] f0, f1 = [1.0] * 201, [0.0] * 201 for i in range(n): nf0, nf1 = [0.0] * 201, [0.0] * 201 if a[i] == -1: ...
output
1
49,651
12
99,303
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,652
12
99,304
Tags: dp Correct Solution: ``` import os from io import BytesIO from math import trunc input = BytesIO(os.read(0, os.fstat(0).st_size)).readline MX = 201 MOD = 998244353 MODF = float(MOD) quickmod = lambda x: x - MODF * trunc(x / MODF) def main(): n = int(input()) a = map(int, input().split()) dp0 = [...
output
1
49,652
12
99,305
Provide tags and a correct Python 3 solution for this coding contest problem. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements at least one of its neighbours ls not less than ...
instruction
0
49,653
12
99,306
Tags: dp Correct Solution: ``` MOD = 998244353.0 float_prec = 1801439850948198.4 float_mod = lambda x: x if -float_prec < x < float_prec else x % MOD n = int(input()) a = [int(i) for i in input().split()] f0, f1 = [1.0] * 201, [0.0] * 201 for i in range(n): nf0, nf1 = [0.0] * 201, [0.0] * 201 if a[i...
output
1
49,653
12
99,307
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,654
12
99,308
Yes
output
1
49,654
12
99,309
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,655
12
99,310
Yes
output
1
49,655
12
99,311
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,656
12
99,312
Yes
output
1
49,656
12
99,313
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,657
12
99,314
Yes
output
1
49,657
12
99,315
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,658
12
99,316
No
output
1
49,658
12
99,317
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,659
12
99,318
No
output
1
49,659
12
99,319
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,660
12
99,320
No
output
1
49,660
12
99,321
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Ivan unexpectedly saw a present from one of his previous birthdays. It is array of n numbers from 1 to 200. Array is old and some numbers are hard to read. Ivan remembers that for all elements a...
instruction
0
49,661
12
99,322
No
output
1
49,661
12
99,323
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,662
12
99,324
Tags: brute force, greedy, implementation Correct Solution: ``` # Author : nitish420 -------------------------------------------------------------------- import os import sys from io import BytesIO, IOBase def main(): n,m=map(int,input().split()) arr=list(map(int,input().split())) left=[[] for _ in range(n)] right...
output
1
49,662
12
99,325
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,663
12
99,326
Tags: brute force, greedy, implementation Correct Solution: ``` R=lambda:map(int,input().split()) n,m=R() l=list(R()) d=max(l)-min(l) s=[] qc=[] for i in range(m): s.append(list(R())) for i in range(1,n+1): str=l.copy() c=[] for j in range(m): if not (i in range(s[j][0],s[j][1]+1)): ...
output
1
49,663
12
99,327
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,664
12
99,328
Tags: brute force, greedy, implementation Correct Solution: ``` import sys input=sys.stdin.readline n,m=map(int,input().split()) x=[*map(int,input().split())] seg=[] for i in range(m): a=[*map(int,input().split())] seg.append(a) ans=-1 ansi=[] for i in range(len(x)): tx=x[:] oi=[] for n,j in enume...
output
1
49,664
12
99,329
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,665
12
99,330
Tags: brute force, greedy, implementation Correct Solution: ``` n,q=map(int,input().split()) l=[int(i) for i in input().split()] eff=[0]*(n+5) qry=[] for i in range(q): a,b=map(int,input().split()) a-=1 b-=1 qry.append([a,b]) maxi=0 res=[] for ans in range(n): l1=l[:] now=l[ans] apply=[]...
output
1
49,665
12
99,331
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,666
12
99,332
Tags: brute force, greedy, implementation Correct Solution: ``` import sys # from prg import * from math import * from copy import copy n, m = input().split() n = int(n) m = int(m) dat = [int(i) for i in input().split()] otr = [] for i in range(m): l, r = input().split() l = int(l) r = int(r) otr.a...
output
1
49,666
12
99,333
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,667
12
99,334
Tags: brute force, greedy, implementation Correct Solution: ``` def f(a,b): # if max(a)<0 and min(a)<0: b=sorted(b,key=lambda s:s[1]-s[0]) t={} for i in range(len(a)): l=[] for j in b: if i in range(j[0],j[1]+1): l.append(j) t[i]=l t=dict(sorted(t.item...
output
1
49,667
12
99,335
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,668
12
99,336
Tags: brute force, greedy, implementation Correct Solution: ``` from sys import stdin,stdout from collections import defaultdict import math #stdin = open('input.txt','r') I = stdin.readline P = stdout.write n,m = map(int,I().split()) arr = [int(x) for x in I().split()] indi = defaultdict(lambda : set()) for j in ran...
output
1
49,668
12
99,337
Provide tags and a correct Python 3 solution for this coding contest problem. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. You are also given a set of m segments. The j-th...
instruction
0
49,669
12
99,338
Tags: brute force, greedy, implementation Correct Solution: ``` import sys input = sys.stdin.readline n,m=map(int,input().split()) A=list(map(int,input().split())) LR=[list(map(int,input().split())) for i in range(m)] def MINUS(A,B): MIN=float("inf") MAX=-float("inf") for i in range(len(A)): if ...
output
1
49,669
12
99,339
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,670
12
99,340
Yes
output
1
49,670
12
99,341
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,671
12
99,342
Yes
output
1
49,671
12
99,343
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,672
12
99,344
Yes
output
1
49,672
12
99,345
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,673
12
99,346
Yes
output
1
49,673
12
99,347
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,674
12
99,348
No
output
1
49,674
12
99,349
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,675
12
99,350
No
output
1
49,675
12
99,351
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,676
12
99,352
No
output
1
49,676
12
99,353
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The only difference between easy and hard versions is a number of elements in the array. You are given an array a consisting of n integers. The value of the i-th element of the array is a_i. Y...
instruction
0
49,677
12
99,354
No
output
1
49,677
12
99,355
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a set of points x_1, x_2, ..., x_n on the number line. Two points i and j can be matched with each other if the following conditions hold: * neither i nor j is matched with any other point; * |x_i - x_j| β‰₯ z. What is...
instruction
0
49,697
12
99,394
Tags: binary search, greedy, sortings, ternary search, two pointers Correct Solution: ``` n,k=map(int,input().split()) a=[int(x) for x in input().split()] ans=0 i,j=0,n//2 l=[] a.sort() while i<n//2 and j<n: if a[j]-a[i]>=k: ans+=1 i+=1 j+=1 else: j+=1 print(ans) ```
output
1
49,697
12
99,395
Provide tags and a correct Python 3 solution for this coding contest problem. You are given a set of points x_1, x_2, ..., x_n on the number line. Two points i and j can be matched with each other if the following conditions hold: * neither i nor j is matched with any other point; * |x_i - x_j| β‰₯ z. What is...
instruction
0
49,700
12
99,400
Tags: binary search, greedy, sortings, ternary search, two pointers Correct Solution: ``` import math def can(arr, count, min_dist): for i in range(count): if arr[len(arr) - count + i] - arr[i] < min_dist: return False return True def binsearch(arr, from_, to_, min_dist): arr.sort() ...
output
1
49,700
12
99,401
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,802
12
99,604
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` import math input_list = lambda: list(map(int, input().split())) def main(): n = int(input()) a = input_list() temp = [] ans = 0 for bit in range(26): temp.clear() ...
output
1
49,802
12
99,605
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,803
12
99,606
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` import sys input = sys.stdin.readline n = int(input()) a = list(map(int, input().split())) b = a ans = 0 for k in range(29): a0 = [] a1 = [] a0a = a0.append a1a = a1.append b0 = [] ...
output
1
49,803
12
99,607
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,804
12
99,608
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` import sys input = sys.stdin.readline n=int(input()) A=list(map(int,input().split())) ANS=0 for i in range(26): B=[] for a in A: B.append(a & ((1<<(i+1))-1)) B.sort() j0=n-1 j1=...
output
1
49,804
12
99,609
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,805
12
99,610
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` from sys import stdin, stdout import math def main(): n = int(stdin.readline()) arr = list(map(int, stdin.readline().split())) ans = 0 for bit in range(25): mask = (1<<bit+1)-1 ...
output
1
49,805
12
99,611
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,806
12
99,612
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` # by the authority of GOD author: manhar singh sachdev # import os,sys from io import BytesIO, IOBase def cal(arr,mask): su,j = 0,0 for i in range(len(arr)-1,-1,-1): while j != len(arr) an...
output
1
49,806
12
99,613
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,807
12
99,614
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` import sys, math import io, os #data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline from bisect import bisect_left as bl, bisect_right as br, insort from heapq import heapify, heappush, heappop from coll...
output
1
49,807
12
99,615
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,808
12
99,616
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` from collections import defaultdict from queue import deque def arrinp(): return [*map(int, input().split(' '))] def mulinp(): return map(int, input().split(' ')) def intinp(): return int(inpu...
output
1
49,808
12
99,617
Provide tags and a correct Python 3 solution for this coding contest problem. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for each one she came up with. But when she came up w...
instruction
0
49,809
12
99,618
Tags: binary search, bitmasks, constructive algorithms, data structures, math, sortings Correct Solution: ``` for z in range(1): co=0 n=int(input()) l=list(map(int, input().split())) for e in range(1,25): po=2**e re=sorted([k%po for k in l]) b=n r=0 for a in range...
output
1
49,809
12
99,619
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,810
12
99,620
Yes
output
1
49,810
12
99,621
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,811
12
99,622
Yes
output
1
49,811
12
99,623
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,812
12
99,624
Yes
output
1
49,812
12
99,625
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,813
12
99,626
Yes
output
1
49,813
12
99,627
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,814
12
99,628
No
output
1
49,814
12
99,629
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,815
12
99,630
No
output
1
49,815
12
99,631
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,816
12
99,632
No
output
1
49,816
12
99,633
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Catherine received an array of integers as a gift for March 8. Eventually she grew bored with it, and she started calculated various useless characteristics for it. She succeeded to do it for ea...
instruction
0
49,817
12
99,634
No
output
1
49,817
12
99,635
Provide tags and a correct Python 3 solution for this coding contest problem. Shubham has an array a of size n, and wants to select exactly x elements from it, such that their sum is odd. These elements do not have to be consecutive. The elements of the array are not guaranteed to be distinct. Tell him whether he can...
instruction
0
49,834
12
99,668
Tags: brute force, implementation, math Correct Solution: ``` import math import sys import collections from collections import defaultdict from sys import stdin, stdout sys.setrecursionlimit(10**9) for _ in range(int(input())): n,x=map(int,input().split()) arr=list(map(int,input().split())) e,o=0,0 fo...
output
1
49,834
12
99,669