message
stringlengths
2
67k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
463
109k
cluster
float64
19
19
__index_level_0__
int64
926
217k
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,764
19
13,528
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` import sys import math from collections import defaultdict import heapq def getnum(num): cnt=0 ans=0 while((1<<cnt)<=num): ans=cnt cnt+=1 if num==0: return 0 return ans+1 t=int(sys.stdin....
output
1
6,764
19
13,529
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,765
19
13,530
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` from __future__ import division, print_function import os,sys from io import BytesIO, IOBase if sys.version_info[0] < 3: from __builtin__ import xrange as range from future_builtins import ascii, filter, hex, map, oct, zip ...
output
1
6,765
19
13,531
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,766
19
13,532
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` ''' Auther: ghoshashis545 Ashis Ghosh College: jalpaiguri Govt Enggineering College ''' from os import path import sys from heapq import heappush,heappop,heapify from functools import cmp_to_key as ctk from collections impor...
output
1
6,766
19
13,533
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,767
19
13,534
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` import sys input = sys.stdin.readline for _ in range(int(input())): n = int(input()) a = list(map(int, input().split())) ones = [0]*40 for i in range(40): for ai in a: ones[i] += (ai>>i)&1 ...
output
1
6,767
19
13,535
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,768
19
13,536
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` for _ in range(int(input())): n=int(input()) a=[int(o) for o in input().split()] ones=[0]*35 zeros= [0]*35 for i in a: ba=bin(i)[2:][::-1] j=-1 for k in ba: if k=='1': ...
output
1
6,768
19
13,537
Provide tags and a correct Python 3 solution for this coding contest problem. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initially a score equal to 0. Koa starts. Let's des...
instruction
0
6,769
19
13,538
Tags: bitmasks, constructive algorithms, dp, games, greedy, math Correct Solution: ``` def solve(): n = int(input()) lst = list(map(int,input().split())) k = 1 while k < 10**9: k *= 2 num = 0 while k and num % 2 == 0: num = 0 for i in lst: if i % (k * 2) // k ...
output
1
6,769
19
13,539
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,770
19
13,540
Yes
output
1
6,770
19
13,541
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,771
19
13,542
Yes
output
1
6,771
19
13,543
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,772
19
13,544
Yes
output
1
6,772
19
13,545
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,773
19
13,546
Yes
output
1
6,773
19
13,547
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,774
19
13,548
No
output
1
6,774
19
13,549
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,775
19
13,550
No
output
1
6,775
19
13,551
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,776
19
13,552
No
output
1
6,776
19
13,553
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Koa the Koala and her best friend want to play a game. The game starts with an array a of length n consisting of non-negative integers. Koa and her best friend move in turns and each have initi...
instruction
0
6,777
19
13,554
No
output
1
6,777
19
13,555
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,794
19
13,588
Tags: greedy, implementation, sortings Correct Solution: ``` for t in range(int(input())): n,k=map(int,input().split()) s=input() if k>=n: print(n*2-1) continue l=0 inter=[] count=0 out=0 for i in s: if i=='L': l+=1 count+=1 else: ...
output
1
6,794
19
13,589
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,795
19
13,590
Tags: greedy, implementation, sortings Correct Solution: ``` for _ in " "*int(input()): n,k=map(int,input().split()) s=list(input()) if "W" not in s: print(max((min(k,n)*2)-1,0)) elif k >= s.count("L"): print((n*2)-1) else: cnt,sm,ind=list(),s.count("W"),s.index("W") for i in range(ind+1,n): ...
output
1
6,795
19
13,591
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,796
19
13,592
Tags: greedy, implementation, sortings Correct Solution: ``` for _ in range(int(input())): n, k = map(int, input().split()) x = 1 X = [] ans = 0 y = 0 for s in input(): if s == 'W': y = 1 if x: X += [x] ans += 1 ...
output
1
6,796
19
13,593
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,797
19
13,594
Tags: greedy, implementation, sortings Correct Solution: ``` nums = int(input().strip()) for _ in range(nums): n,k = map(int,input().strip().split()) s = input().strip() lw,rw = s.find("W"),s.rfind("W") res = cur_num = 0 if lw==rw: if lw==-1: res = 2*k-1 else: ...
output
1
6,797
19
13,595
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,798
19
13,596
Tags: greedy, implementation, sortings Correct Solution: ``` for _ in range(int(input())): n,k=map(int,input().split()) s=input() s=list(s) cw=0 w=[] idx=-1 cl=0 fw=-1 lw=-1 ans = 0 for i in range(n): if(s[i]=='W'): if(i>0 and s[i-1]=='W'): ...
output
1
6,798
19
13,597
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,799
19
13,598
Tags: greedy, implementation, sortings Correct Solution: ``` I=input for _ in[0]*int(I()): n,k=map(int,I().split());s=I();c=s.count('W');n=min(n,c+k);a=sorted(map(len,filter(None,s.strip('L').split('W')))) while a and c+a[0]<=n:c+=a.pop(0) print((2*n-len(a)or 1)-1) ```
output
1
6,799
19
13,599
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,800
19
13,600
Tags: greedy, implementation, sortings Correct Solution: ``` def score(a,n): score = 0 if a[0]=='L' else 1 for i in range(1,n): if a[i]==a[i-1] =='W': score+=2 elif a[i]=='W': score+=1 return score t = int(input()) for _ in range(t): n,k = map(int,input().split()) s = input() mylist...
output
1
6,800
19
13,601
Provide tags and a correct Python 3 solution for this coding contest problem. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you get 0 points. When you win you get 1 or 2 points...
instruction
0
6,801
19
13,602
Tags: greedy, implementation, sortings Correct Solution: ``` t = int(input()) for it in range(0, t): n, k = tuple(list(map(int, input().split(' ')))) results = [char for char in input()] initial_score = 0 loss_amount = 0 for i in range(0, len(results)): if i > 0 and results[i] == 'W' and r...
output
1
6,801
19
13,603
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,802
19
13,604
Yes
output
1
6,802
19
13,605
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,803
19
13,606
Yes
output
1
6,803
19
13,607
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,804
19
13,608
Yes
output
1
6,804
19
13,609
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,805
19
13,610
Yes
output
1
6,805
19
13,611
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,806
19
13,612
No
output
1
6,806
19
13,613
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,807
19
13,614
No
output
1
6,807
19
13,615
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,808
19
13,616
No
output
1
6,808
19
13,617
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. You like playing chess tournaments online. In your last tournament you played n games. For the sake of this problem, each chess game is either won or lost (no draws). When you lose a game you g...
instruction
0
6,809
19
13,618
No
output
1
6,809
19
13,619
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,977
19
13,954
Tags: games, greedy, sortings Correct Solution: ``` from sys import stdin from collections import deque import heapq n = int(stdin.readline()) piles = [] for x in range(n): a = [int(x) for x in stdin.readline().split()][1:] piles.append(a) cielTotal = 0 jiroTotal = 0 mids = [] for x in piles: cielTotal...
output
1
6,977
19
13,955
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,978
19
13,956
Tags: games, greedy, sortings Correct Solution: ``` n = int(input()) a,b = 0,0 l = [] for _ in range(n): inpt = list(map(int,input().split()))[1:] li = len(inpt) if li%2: l.append(inpt[li//2]) a += sum((inpt[:li//2])) b += sum((inpt[(li + 1)//2:])) l.sort(reverse=True) a += sum(l[::2]) b += ...
output
1
6,978
19
13,957
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,979
19
13,958
Tags: games, greedy, sortings Correct Solution: ``` #!/usr/bin/env python3 odd, even = [], [] player1_turn = True player1 = player2 = 0 pile_number = int(input()) for _ in range(pile_number): n, *pile = tuple(map(int, input().split())) if n % 2 == 0: even.append(pile) else: odd.append(pile...
output
1
6,979
19
13,959
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,980
19
13,960
Tags: games, greedy, sortings Correct Solution: ``` from functools import reduce n = int(input()) cards = [list(map(int, input().split()[1:])) for i in range(n)] mid = sorted((c[len(c) >> 1] for c in cards if len(c) & 1 == 1), reverse=True) add = lambda x=0, y=0: x + y a, b = reduce(add, mid[::2] or [0]), reduce(add, ...
output
1
6,980
19
13,961
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,981
19
13,962
Tags: games, greedy, sortings Correct Solution: ``` n = int(input()) S = [0] * n ciel, giro = 0, 0 odd = [] for i in range(n): L = list(map(int, input().split())) k = L[0] L = L[1:] S[i] = sum(L) if k % 2: odd.append(L[k // 2]) ciel += sum(L[:k // 2]) giro += sum(L[(k + 1) // 2...
output
1
6,981
19
13,963
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,982
19
13,964
Tags: games, greedy, sortings Correct Solution: ``` n = int(input()) c = [list(map(int, input().split())) for _ in range(n)] a, b = 0, 0 d = [] for i in range(n): if len(c[i]) % 2: a += sum(c[i][1:c[i][0]//2+1]) b += sum(c[i][c[i][0]//2+1:]) else: a += sum(c[i][1:c[i][0]//2+1]) b...
output
1
6,982
19
13,965
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,983
19
13,966
Tags: games, greedy, sortings Correct Solution: ``` n = int(input()) a = b = 0 s = [] for _ in range(n): l = [*map(int, input().split())][1:] m = len(l) if m & 1: s.append(l[m//2]) a += sum((l[:m//2])) b += sum((l[(m + 1)//2:])) s.sort(reverse = True) a += sum(s[::2]) b += sum(s[1::2]) print...
output
1
6,983
19
13,967
Provide tags and a correct Python 3 solution for this coding contest problem. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first turn. In Ciel's turn she takes a card from the ...
instruction
0
6,984
19
13,968
Tags: games, greedy, sortings Correct Solution: ``` p, n = [], int(input()) a = b = 0 for i in range(n): t = list(map(int, input().split())) k = t[0] // 2 + 1 a += sum(t[1: k]) if t[0] & 1: p.append(t[k]) b += sum(t[k + 1: ]) else: b += sum(t[k: ]) p.sort(reverse = True) print(a + su...
output
1
6,984
19
13,969
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,985
19
13,970
Yes
output
1
6,985
19
13,971
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,986
19
13,972
Yes
output
1
6,986
19
13,973
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,987
19
13,974
Yes
output
1
6,987
19
13,975
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,988
19
13,976
Yes
output
1
6,988
19
13,977
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,989
19
13,978
No
output
1
6,989
19
13,979
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,990
19
13,980
No
output
1
6,990
19
13,981
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,991
19
13,982
No
output
1
6,991
19
13,983
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Fox Ciel is playing a card game with her friend Fox Jiro. There are n piles of cards on the table. And there is a positive integer on each card. The players take turns and Ciel takes the first ...
instruction
0
6,992
19
13,984
No
output
1
6,992
19
13,985
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says...
instruction
0
7,206
19
14,412
Tags: math, number theory Correct Solution: ``` # ---------------------------iye ha aam zindegi--------------------------------------------- import math import heapq, bisect import sys from collections import deque, defaultdict from fractions import Fraction mod = 10 ** 9 + 7 mod1 = 998244353 # ----------------------...
output
1
7,206
19
14,413
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says...
instruction
0
7,207
19
14,414
Tags: math, number theory Correct Solution: ``` import sys,os,io from sys import stdin from math import log, gcd, ceil from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify from bisect import bisect_left , bisect_right import math def ii(): return int(input()) def li(): ...
output
1
7,207
19
14,415
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says...
instruction
0
7,208
19
14,416
Tags: math, number theory Correct Solution: ``` import sys input = sys.stdin.readline print = sys.stdout.write cbrt = {i**3:i for i in range(1001)} n = int(input()) all_res = [] for _ in range(n): a, b = map(int, input().split()) if a == b: all_res.append('Yes' if a in cbrt else 'No') continue ...
output
1
7,208
19
14,417
Provide tags and a correct Python 3 solution for this coding contest problem. <image> Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting. The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says...
instruction
0
7,209
19
14,418
Tags: math, number theory Correct Solution: ``` #Code by Sounak, IIESTS #------------------------------warmup---------------------------- import os import sys import math from io import BytesIO, IOBase from fractions import Fraction BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(sel...
output
1
7,209
19
14,419