message
stringlengths
2
20.1k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
1.95k
109k
cluster
float64
17
17
__index_level_0__
int64
3.91k
217k
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,626
17
155,252
Tags: brute force, math, number theory Correct Solution: ``` from sys import stdin, stdout from collections import Counter import math def rsingle_int(): return int(stdin.readline().rstrip()) def rmult_int(): return [ int(x) for x in stdin.readline().rstrip().split() ] def rmult_str(): return stdin.re...
output
1
77,626
17
155,253
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,627
17
155,254
Tags: brute force, math, number theory Correct Solution: ``` n,p,w,d=map(int,input().split()) for i in range(w): if(p-i*d>=0 and (p-i*d)%w==0 and (p-i*d)//w+i<=n): print((p-i*d)//w,i,n-(p-i*d)//w-i) break else: print(-1) ```
output
1
77,627
17
155,255
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,628
17
155,256
Tags: brute force, math, number theory Correct Solution: ``` import math c=0 n,p,w,d=map(int,input().split()) c=0 for i in range(w): nd=i if (p-nd*d)%w==0: nw=(p-nd*d)/w nl=n-nw-nd c=1 break if (w*n<p) or (c==0) or ((p<d) and (p>0)): print (-1) else: print (int(nw)," ",in...
output
1
77,628
17
155,257
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,629
17
155,258
Tags: brute force, math, number theory Correct Solution: ``` l=[int(i) for i in input().split()] m=l[0] p=l[1] w=l[2] d=l[3] if(p>w*m): print(-1) elif(p==w*m): print(m,0,0) elif(p==0): print(0,0,m) elif(m==1000000000000 and p==1000000000000 and w==6 and d==3): print(-1) elif(m==1000000000000...
output
1
77,629
17
155,259
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,630
17
155,260
Tags: brute force, math, number theory Correct Solution: ``` from sys import setrecursionlimit setrecursionlimit(10**8) def extgcd(a,b,x,y): if b==0: x[0]=1 y[0]=0 return a e=extgcd(b,a%b,y,x) y[0]-=(a//b)*x[0] return e n,p,w,d=map(int,input().split()) from math import gcd if p%...
output
1
77,630
17
155,261
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,631
17
155,262
Tags: brute force, math, number theory Correct Solution: ``` n, p, w, d = map(int, input().split()) win = draw = loss = 0 def gcd(a, b): while a % b: a, b = b, a % b return b if p % gcd(w, d): print(-1) else: while p % w and p >= 0: p -= d draw += 1 if p > 0: win =...
output
1
77,631
17
155,263
Provide tags and a correct Python 3 solution for this coding contest problem. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one of the playing teams. If a team wins the match,...
instruction
0
77,632
17
155,264
Tags: brute force, math, number theory Correct Solution: ``` def gcd1(a, b): if (a == 0): return [0, 1] x1, y1 = gcd1(b%a, a) return [y1 - (b // a) * x1, x1] def gcd(a, b): while b: a, b = b, a % b return a def lcm(a, b): return a * b // gcd(a, b) n, p, a, b = map(int, input()...
output
1
77,632
17
155,265
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,633
17
155,266
Yes
output
1
77,633
17
155,267
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,634
17
155,268
Yes
output
1
77,634
17
155,269
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,635
17
155,270
Yes
output
1
77,635
17
155,271
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,636
17
155,272
Yes
output
1
77,636
17
155,273
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,637
17
155,274
No
output
1
77,637
17
155,275
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,638
17
155,276
No
output
1
77,638
17
155,277
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,639
17
155,278
No
output
1
77,639
17
155,279
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. The football season has just ended in Berland. According to the rules of Berland football, each match is played between two teams. The result of each match is either a draw, or a victory of one ...
instruction
0
77,640
17
155,280
No
output
1
77,640
17
155,281
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,641
17
155,282
Tags: greedy, implementation Correct Solution: ``` import sys import collections import heapq import math input = sys.stdin.readline def rints(): return map(int, input().strip().split()) def rstr(): return input().strip() def rint(): return int(input().strip()) def rintas(): return [int(i) for i in input().strip()....
output
1
77,641
17
155,283
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,642
17
155,284
Tags: greedy, implementation Correct Solution: ``` from collections import Counter def solve(arr): mapper = Counter(arr) max_medals = len(arr)//2 if max_medals < 3: return [0, 0, 0] medals = [0, 0, 0] medals[0] = mapper[arr[0]] bound = mapper[arr[0]] while medals[1] <= medals[0] and...
output
1
77,642
17
155,285
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,643
17
155,286
Tags: greedy, implementation Correct Solution: ``` for _ in range(int(input())): n=int(input()) d={} arr=list(map(int,input().split())) for i in arr: d[i]=d.get(i,0)+1 arr=sorted(list(d.keys()),reverse=True) g=d[arr[0]] s=0 b=0 i=1 while(i<len(arr)): if s>g: break s+=d[arr[i]] i+=1 while(i<len(arr...
output
1
77,643
17
155,287
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,644
17
155,288
Tags: greedy, implementation Correct Solution: ``` n = int(input()) for i in range (n): k = int(input()) g = 0 s = 0 b = 0 gcount = 0 scount = 0 bcount = 0 bb = 0 m=list(map(int,input().split())) for j in range(k): if g == 0: g += 1 gcount = m[j] ...
output
1
77,644
17
155,289
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,645
17
155,290
Tags: greedy, implementation Correct Solution: ``` t1=int(input()) while(t1): t1-=1 n=int(input()) a=list(map(int,input().split())) if(n<=2): print(0,0,0) continue b=dict() for i in a: if(i not in b): b[i]=1 continue b[i]+=1 ma=n//2 res=[0]*3 z=0 co=0 for i in b.keys(): if(co==0): res[0]=b...
output
1
77,645
17
155,291
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,646
17
155,292
Tags: greedy, implementation Correct Solution: ``` import sys input = lambda: sys.stdin.readline().rstrip() def first(m): cur = m[-1] if len(m) >= 2: k = 0 while cur == m[-1]: del m[-1] if len(m) == 0: return False if len(m) <= 2: ret...
output
1
77,646
17
155,293
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,647
17
155,294
Tags: greedy, implementation Correct Solution: ``` n = int(input()) for j in range(n): m = int(input()) L = [int(e) for e in input().strip().split()] L = L[: (len(L)//2) + 1 ] if len(L) == 1: pass elif L[-1] == L[-2]: i = -2 while( i >= len(L)*-1 and L[i] == L[-1]): i -= ...
output
1
77,647
17
155,295
Provide tags and a correct Python 3 solution for this coding contest problem. So the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved p_i problems. Since the participants are primarily sorted by th...
instruction
0
77,648
17
155,296
Tags: greedy, implementation Correct Solution: ``` import bisect import collections import copy import functools import heapq import itertools import math import random import re import sys import time import string from typing import List sys.setrecursionlimit(99999) for _ in range(int(input())): n = int(input())...
output
1
77,648
17
155,297
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Tavas is a cheerleader in the new sports competition named "Pashmaks". <image> This competition consists of two part: swimming and then running. People will immediately start running R meters ...
instruction
0
77,852
17
155,704
No
output
1
77,852
17
155,705
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Tavas is a cheerleader in the new sports competition named "Pashmaks". <image> This competition consists of two part: swimming and then running. People will immediately start running R meters ...
instruction
0
77,853
17
155,706
No
output
1
77,853
17
155,707
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Tavas is a cheerleader in the new sports competition named "Pashmaks". <image> This competition consists of two part: swimming and then running. People will immediately start running R meters ...
instruction
0
77,854
17
155,708
No
output
1
77,854
17
155,709
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Tavas is a cheerleader in the new sports competition named "Pashmaks". <image> This competition consists of two part: swimming and then running. People will immediately start running R meters ...
instruction
0
77,855
17
155,710
No
output
1
77,855
17
155,711
Provide tags and a correct Python 3 solution for this coding contest problem. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: * the team...
instruction
0
78,544
17
157,088
Tags: brute force, implementation Correct Solution: ``` # HEY STALKER def get_sort(team): lt = sorted(team, reverse=True) for _ in range(6): for tt in range(1, 4): if lt[tt-1][0] == lt[tt][0] and lt[tt-1][1] == lt[tt][1] and lt[tt-1][2] == lt[tt][2]: if lt[tt-1][3] > lt[tt][...
output
1
78,544
17
157,089
Provide tags and a correct Python 3 solution for this coding contest problem. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: * the team...
instruction
0
78,545
17
157,090
Tags: brute force, implementation Correct Solution: ``` import copy teams = {} times = {} def put_team(s): if not s[0] in teams: teams[s[0]] = [0, 0, 0, s[0]] if not s[1] in teams: teams[s[1]] = [0, 0, 0, s[1]] g1, g2 = map(int, s[2].split(':')) teams[s[0]][1] -= g1 - g2 teams[s[1]...
output
1
78,545
17
157,091
Provide tags and a correct Python 3 solution for this coding contest problem. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: * the team...
instruction
0
78,546
17
157,092
Tags: brute force, implementation Correct Solution: ``` from collections import defaultdict from functools import cmp_to_key def main(): goals = defaultdict(lambda:0) missing = defaultdict(lambda:0) points = defaultdict(lambda:0) names = set() played = set() for i in range(5): ln = inp...
output
1
78,546
17
157,093
Provide tags and a correct Python 3 solution for this coding contest problem. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal rules of the local championship: * the team...
instruction
0
78,547
17
157,094
Tags: brute force, implementation Correct Solution: ``` import os,io from sys import stdout import collections # import random # import math # from operator import itemgetter input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline # from collections import Counter # from decimal import Decimal # import heapq # from...
output
1
78,547
17
157,095
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal ...
instruction
0
78,548
17
157,096
No
output
1
78,548
17
157,097
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal ...
instruction
0
78,549
17
157,098
No
output
1
78,549
17
157,099
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal ...
instruction
0
78,550
17
157,100
No
output
1
78,550
17
157,101
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Any resemblance to any real championship and sport is accidental. The Berland National team takes part in the local Football championship which now has a group stage. Let's describe the formal ...
instruction
0
78,551
17
157,102
No
output
1
78,551
17
157,103
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,473
17
158,946
Tags: dp, implementation, math Correct Solution: ``` c, d = map(int, input().split()) n, m = map(int, input().split()) p = 0 k = int(input()) if m*n <= k: print(0) else: a = [0]*(m*n+1) #a[k+1] = min(c,d) for i in range(k+1,m*n+1): a[i] = min(a[i-n]+c, a[i-1]+d) print(a[m*n]) ```
output
1
79,473
17
158,947
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,474
17
158,948
Tags: dp, implementation, math Correct Solution: ``` c, d = [int(i) for i in input().split(" ")] n, m = [int(i) for i in input().split(" ")] k = int(input()) s = n*m - k s = max(s, 0) if c < d*n: stuff = s//n try1 = c*stuff + d*(s-n*stuff) try2 = c*(stuff+1) print(min(try1, try2)) else: print(d*s) ```
output
1
79,474
17
158,949
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,475
17
158,950
Tags: dp, implementation, math Correct Solution: ``` import math as mt import sys,string input=sys.stdin.readline import random from collections import deque,defaultdict L=lambda : list(map(int,input().split())) Ls=lambda : list(input().split()) M=lambda : map(int,input().split()) I=lambda :int(input()) c,d=M() n,m=M(...
output
1
79,475
17
158,951
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,476
17
158,952
Tags: dp, implementation, math Correct Solution: ``` c, d = map(int, input().split(' ')) n, m = map(int, input().split(' ')) k = int(input()) dp = [0] * 100000 need = n*m - k if need <= 0: print(0) quit() for i in range(1, 100000): dp[i] = min(dp[i-n]+c, dp[i-1]+d) print(dp[need]) ```
output
1
79,476
17
158,953
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,477
17
158,954
Tags: dp, implementation, math Correct Solution: ``` #Codeforces problem 417A: Elimination def roof(n,p): r = p // n if p%n > 0: r = r + 1 return r c,d = (int(element) for element in input().split()) n,m = (int(element) for element in input().split()) k = int(input()) needed_number_of_problems = 0 #people st...
output
1
79,477
17
158,955
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,478
17
158,956
Tags: dp, implementation, math Correct Solution: ``` [c, d], [n, m], k = map(int, input().split()), map(int, input().split()), int(input()) left = n * m - k if left <= 0: print(0) else: print(min(left // n * c + left % n * d, (left + n - 1) // n * c, left * d)) ```
output
1
79,478
17
158,957
Provide tags and a correct Python 3 solution for this coding contest problem. The finalists of the "Russian Code Cup" competition in 2214 will be the participants who win in one of the elimination rounds. The elimination rounds are divided into main and additional. Each of the main elimination rounds consists of c pr...
instruction
0
79,479
17
158,958
Tags: dp, implementation, math Correct Solution: ``` # arr=list(map(int,input().split())) # arr=sorted([(n-int(x),i) for i,x in enumerate(input().split())]) # arr=[int(q)-1 for q in input().split()] # from collections import Counter # n=int(input()) # n,k=map(int,input().split()) # arr=list(map(int,input().split())) # ...
output
1
79,479
17
158,959
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n players numbered from 0 to n-1 with ranks. The i-th player has rank i. Players can form teams: the team should consist of three players and no pair of players in the team should hav...
instruction
0
79,681
17
159,362
No
output
1
79,681
17
159,363
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n players numbered from 0 to n-1 with ranks. The i-th player has rank i. Players can form teams: the team should consist of three players and no pair of players in the team should hav...
instruction
0
79,682
17
159,364
No
output
1
79,682
17
159,365
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n players numbered from 0 to n-1 with ranks. The i-th player has rank i. Players can form teams: the team should consist of three players and no pair of players in the team should hav...
instruction
0
79,683
17
159,366
No
output
1
79,683
17
159,367
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. There are n players numbered from 0 to n-1 with ranks. The i-th player has rank i. Players can form teams: the team should consist of three players and no pair of players in the team should hav...
instruction
0
79,684
17
159,368
No
output
1
79,684
17
159,369
Provide tags and a correct Python 3 solution for this coding contest problem. There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas and certificates are cal...
instruction
0
80,510
17
161,020
Tags: implementation, math Correct Solution: ``` n, k = map(int, input().split()) a = (n // 2) // (k + 1) b = a * k print(a, b, n - a - b) ```
output
1
80,510
17
161,021
Provide tags and a correct Python 3 solution for this coding contest problem. There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas and certificates are cal...
instruction
0
80,511
17
161,022
Tags: implementation, math Correct Solution: ``` n, k = input().split() n, k = int(n), int(k) dip = gram = 0 dip = int( (n/2) / (k+1)) gram = int(dip * k) if (dip + gram > n/2): print(0, 0, n, end=' ') else: other=n-dip-gram print(int(dip), int(gram), int(other), end=' ') ```
output
1
80,511
17
161,023
Provide tags and a correct Python 3 solution for this coding contest problem. There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas and certificates are cal...
instruction
0
80,512
17
161,024
Tags: implementation, math Correct Solution: ``` #1. diploma t=list(map(int,input().split())) half=t[0]//2 if(t[1]>half): print(*[0,0,t[0]]) elif(t[1]<=half): s=half//(t[1]+1) p=abs(half-s-t[1]*s) print(*[s,t[1]*s,t[0]-half+p]) ```
output
1
80,512
17
161,025
Provide tags and a correct Python 3 solution for this coding contest problem. There are n students who have taken part in an olympiad. Now it's time to award the students. Some of them will receive diplomas, some wiil get certificates, and others won't receive anything. Students with diplomas and certificates are cal...
instruction
0
80,513
17
161,026
Tags: implementation, math Correct Solution: ``` n, k = map(int, input().split()) d = n//2//(k+1) print(d, k*d, n-(k+1)*d) ```
output
1
80,513
17
161,027