message
stringlengths
2
44.5k
message_type
stringclasses
2 values
message_id
int64
0
1
conversation_id
int64
276
109k
cluster
float64
23
23
__index_level_0__
int64
552
217k
Provide a correct Python 3 solution for this coding contest problem. JOI is playing with a nail in the board. As shown in the figure below, JOI stabbed nails in the shape of an equilateral triangle with N sides. A nails are lined up in the ath line (1 ≤ a ≤ N) from the top. The bth nail (1 ≤ b ≤ a) from the left is re...
instruction
0
29,940
23
59,880
"Correct Solution: ``` from collections import deque n,m=map(int,input().split()) abx=[[0]*(n+2) for i in range(n+2)] for i in range(m): ai,bi,xi=map(int,input().split()) abx[ai][bi]=max(abx[ai][bi],xi) pp=[[0]*(n+2) for i in range(n+2)] for j in range(1,n+2): dq=deque() for i in range(j,n+2): ...
output
1
29,940
23
59,881
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,941
23
59,882
"Correct Solution: ``` def area(px,py,x,y): if py > y: py,y = y,py return py*(x-px)+(x-px)*abs(y-py)/2 count = 1 while True: res = 0 n = int(input()) if n == 0: break px,py = map(int,input().split()) sx,sy = px,py for _ in range(n-1): x,y = map(int,input().split(...
output
1
29,941
23
59,883
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,942
23
59,884
"Correct Solution: ``` def cal(a,b): return a[0]*b[1]-a[1]*b[0] c=1 while 1: N=int(input()) if N==0: break p=[tuple(map(int, input().split())) for _ in range(N)] input() S=0 for i in range(N): S += cal(p[i],p[i-1]) S=abs(S/2) print("{} {}".format(c,S)) c+=1 ```
output
1
29,942
23
59,885
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,943
23
59,886
"Correct Solution: ``` # AOJ 1100: Area of Polygons # Python3 2018.7.14 bal4u from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN def calc_area(pp): n = len(pp) if n < 3: return 0 s = 0 for i in range(n): s += (pp[i].real-pp[(i+1)%n].real)*(pp[i].imag+pp[(i+1)%n].imag) return abs(s)/2 cno = 0 while Tr...
output
1
29,943
23
59,887
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,944
23
59,888
"Correct Solution: ``` idx = 1 while True: n = int(input()) if n==0: break x = [] y = [] for _ in range(n): a,b = map(int,input().split()) x.append(a) y.append(b) x.append(x[0]) y.append(y[0]) s = 0.0 for i in range(n): s += x[i]*y[i+1] - x[i+1]*y[i] ...
output
1
29,944
23
59,889
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,945
23
59,890
"Correct Solution: ``` c=0 while 1: n=int(input()) if n==0:break c+=1 p=[complex(*map(int,input().split())) for _ in range(n)] s,pre=0,p[0] while p: now=p.pop() s+=now.real*pre.imag-now.imag*pre.real pre=now print(c,abs(s)/2);input() ```
output
1
29,945
23
59,891
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,946
23
59,892
"Correct Solution: ``` def cp(a, b):return a[0] * b[1] - a[1] * b[0] c = 1 while 1: n = int(input()) if n == 0:break p = [tuple(map(int, input().split())) for _ in range(n)] input() s = 0 for i in range(n):s += cp(p[i], p[i - 1]) s = abs(s / 2) print("{} {}".format(c,s)) c += 1 ```
output
1
29,946
23
59,893
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,947
23
59,894
"Correct Solution: ``` from os import sys n = int(input()) c = 1 while True: if n == 0: sys.exit(0) X = 0 Y = 0 ox = 0 oy = 0 esquerda = 0 direita = 0 for i in range(0,n): cx, cy = input().split(' ') cx = int(cx) cy = int(cy) if i == 0: ...
output
1
29,947
23
59,895
Provide a correct Python 3 solution for this coding contest problem. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of geometric data, you'd better try some programming exerc...
instruction
0
29,948
23
59,896
"Correct Solution: ``` def det(a,b): return a[0]*b[1] - a[1]*b[0] cnt = 1 while True : n = int(input()) if n==0: break dots = [] std = list(map(int,input().split())) for i in range(n-1): dots.append(list(map(int,input().split()))) #print(dots) dots2 = [] for dot i...
output
1
29,948
23
59,897
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,949
23
59,898
Yes
output
1
29,949
23
59,899
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,950
23
59,900
Yes
output
1
29,950
23
59,901
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,951
23
59,902
Yes
output
1
29,951
23
59,903
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,952
23
59,904
Yes
output
1
29,952
23
59,905
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,953
23
59,906
No
output
1
29,953
23
59,907
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,954
23
59,908
No
output
1
29,954
23
59,909
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,955
23
59,910
No
output
1
29,955
23
59,911
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Polygons are the most fundamental objects in geometric processing. Complex figures are often represented and handled as polygons with many short sides. If you are interested in the processing of...
instruction
0
29,956
23
59,912
No
output
1
29,956
23
59,913
Provide a correct Python 3 solution for this coding contest problem. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since the square is very wide Taro decided to look for the trea...
instruction
0
29,981
23
59,962
"Correct Solution: ``` from bisect import bisect_left as bl def main(): n, m = map(int, input().split()) plst = [] xlst = set() ylst = set() for _ in range(n): x, y = map(int, input().split()) plst.append((x, y)) xlst.add(x) ylst.add(y) xlst = sorted(list(xlst)) ylst = sorted(list(ylst)...
output
1
29,981
23
59,963
Provide a correct Python 3 solution for this coding contest problem. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since the square is very wide Taro decided to look for the trea...
instruction
0
29,982
23
59,964
"Correct Solution: ``` """ AOJ 2426 Treasure Hunt 座標圧縮を二次元でやるっぽい 上の問題たちとちがうのは、ここからここまでが領域1です、みたいな形になっている点か。 また、例4をみると、ある領域の内側に小さな領域があるパターンもあり、小さいほうに入っている宝は両方に所属していることになるっぽい。 さっぱりなので写経 http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2963309#1 二次元累積和がはじめてなので、そっちの練習がまず先に必要っぽい """ from bisect import bisect_left ...
output
1
29,982
23
59,965
Provide a correct Python 3 solution for this coding contest problem. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since the square is very wide Taro decided to look for the trea...
instruction
0
29,983
23
59,966
"Correct Solution: ``` import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int...
output
1
29,983
23
59,967
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since t...
instruction
0
29,984
23
59,968
No
output
1
29,984
23
59,969
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since t...
instruction
0
29,985
23
59,970
No
output
1
29,985
23
59,971
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since t...
instruction
0
29,986
23
59,972
No
output
1
29,986
23
59,973
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,044
23
60,088
"Correct Solution: ``` n,m=map(int,input().split()) a = [[int(x) for x in input().split()] for _ in range(n)] b = [int(input()) for _ in range(m)] for i in range(n): s = 0 for j in range(m): s += a[i][j] * b[j] print(s) ```
output
1
30,044
23
60,089
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,045
23
60,090
"Correct Solution: ``` n,m=map(int, input().split()) A=[list(map(int,input().split())) for i in range(n)] b=[list(map(int,input().split())) for i in range(m)] for i in range(n): c=[] for j in range(m): c += A[i][j]*b[j] print(sum(c)) ```
output
1
30,045
23
60,091
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,046
23
60,092
"Correct Solution: ``` f=lambda:list(map(int,input().split())) n,m=f() M=[f()for _ in [0]*n] V=[f()[0]for _ in [0]*m] for v in M:print(sum(i*j for i,j in zip(v,V))) ```
output
1
30,046
23
60,093
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,047
23
60,094
"Correct Solution: ``` n, m = list(map(int, input().split())) matrix_a = [list(map(int, input().split())) for i in range(n)] matrix_b = [int(input()) for i in range(m)] for i in range(n): print(sum([x*y for (x,y) in zip(matrix_b,matrix_a[i])])) ```
output
1
30,047
23
60,095
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,048
23
60,096
"Correct Solution: ``` n,m=map(int,input().split()) A=[input().split()for _ in[0]*n] b=[input()for _ in[0]*m] for a in A:print(sum(int(x)*int(y)for x,y in zip(a,b))) ```
output
1
30,048
23
60,097
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,049
23
60,098
"Correct Solution: ``` n,m = map(int,input().split()) v1 = [ input().split() for _ in range(n) ] v2 = [ int(input()) for _ in range(m) ] l = [sum(map(lambda x,y:int(x)*y,v,v2)) for v in v1 ] print(*l,sep="\n") ```
output
1
30,049
23
60,099
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,050
23
60,100
"Correct Solution: ``` N, M = map(int, input().split()) A = [] for i in range(N): A.append(list(map(int, input().split()))) for i in range(M): bi = int(input()) for j in range(N): A[j][i] *= bi for i in range(N): print(sum(A[i])) ```
output
1
30,050
23
60,101
Provide a correct Python 3 solution for this coding contest problem. Write a program which reads a $ n \times m$ matrix $A$ and a $m \times 1$ vector $b$, and prints their product $Ab$. A column vector with m elements is represented by the following equation. \\[ b = \left( \begin{array}{c} b_1 \\\ b_2 \\\ : \\\ b_m...
instruction
0
30,051
23
60,102
"Correct Solution: ``` n,m=map(int,input().split()) a = [input().split() for l in range(n)] b=[int(input()) for i in range(m)] du=0 for v in range(n): for k in range(m): du+=int(a[v][k])*b[k] print(du) du=0 ```
output
1
30,051
23
60,103
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,387
23
60,774
Tags: brute force, geometry Correct Solution: ``` n = int(input()) l = [] def cross(x1,y1,x2,y2): area = x1*y2 - y1*x2 return area for i in range(n): x,y = map(int,input().split()) l.append([x,y]) max_upper = 0 max_lower = 0 ans = 0 for i in range(n-1): for j in range(i+1,n): max_upp...
output
1
30,387
23
60,775
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,388
23
60,776
Tags: brute force, geometry Correct Solution: ``` def cross(x1, y1, x2, y2): return x1 * y2 - x2 * y1 def gao(): n = int(input()) x, y = [], [] for i in range(n): x1, y1 = input().split(' ') x.append(int(x1)) y.append(int(y1)) max_area = 0 for i in range(n): for...
output
1
30,388
23
60,777
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,389
23
60,778
Tags: brute force, geometry Correct Solution: ``` n = int(input()) a = [] area = 0 for i in range(n): a.append([int(i) for i in input().split(' ')]) def get_s(p1, p2, p3): return ((p2[0] - p1[0]) * (p3[1] - p1[1]) - (p2[1] - p1[1]) * (p3[0] - p1[0])) / 2.0 for i in range(len(a) - 1): for j in range(i + ...
output
1
30,389
23
60,779
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,390
23
60,780
Tags: brute force, geometry Correct Solution: ``` import sys c, n = 0, int(input()) t = list(map(int, sys.stdin.read().split())) p = [complex(t[i], t[i + 1]) for i in range(0, 2 * n, 2)] for x, i in enumerate(p, 1): for j in p[x:]: a = b = 0 for k in p: if k == i or k == j: continue ...
output
1
30,390
23
60,781
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,391
23
60,782
Tags: brute force, geometry Correct Solution: ``` # calculate convex of polygon v. # v is list of complexes stand for points. def convex(v, eps=1e-8): # fetch the seed point v.sort(key=lambda x:(x.real,x.imag)) v = v[0:1] + sorted(v[1:], key=lambda x:(x-v[0]).imag/abs(x-v[0])) n = 1 for i in range...
output
1
30,391
23
60,783
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,392
23
60,784
Tags: brute force, geometry Correct Solution: ``` import sys s, n = 0, int(input()) t = list(map(int, sys.stdin.read().split())) p = [(t[2 * i], t[2 * i + 1]) for i in range(n)] for x, i in enumerate(p, 1): for j in p[x:]: a = b = 0 for k in p: d = (i[0] - k[0]) * (j[1] - k[1]) - (i[1] -...
output
1
30,392
23
60,785
Provide tags and a correct Python 3 solution for this coding contest problem. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and four vertices (also called corners). Please note...
instruction
0
30,393
23
60,786
Tags: brute force, geometry Correct Solution: ``` def convex(p): p.sort(key = lambda x:(x.real, x.imag)) p = p[0:1] + sorted(p[1:], key = lambda x:(x-p[0]).imag / abs(x-p[0])) j = 1 for i in range(2, len(p)): while j > 1 and ((p[j] - p[j-1]) * (p[i] - p[j]).conjugate()).imag > -(1e-8): ...
output
1
30,393
23
60,787
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and f...
instruction
0
30,394
23
60,788
No
output
1
30,394
23
60,789
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and f...
instruction
0
30,395
23
60,790
No
output
1
30,395
23
60,791
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and f...
instruction
0
30,396
23
60,792
No
output
1
30,396
23
60,793
Evaluate the correctness of the submitted Python 3 solution to the coding contest problem. Provide a "Yes" or "No" response. Iahub has drawn a set of n points in the cartesian plane which he calls "special points". A quadrilateral is a simple polygon without self-intersections with four sides (also called edges) and f...
instruction
0
30,397
23
60,794
No
output
1
30,397
23
60,795
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,831
23
61,662
"Correct Solution: ``` a=[int(input()) for i in range(3)];print((a[0]+a[1])*a[2]//2) ```
output
1
30,831
23
61,663
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,832
23
61,664
"Correct Solution: ``` a, b, h = [int(input()) for i in range(3)] print(int((a + b) * h / 2)) ```
output
1
30,832
23
61,665
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,833
23
61,666
"Correct Solution: ``` a = int(input()) b = int(input()) c = int(input()) print(c*(a+b)//2) ```
output
1
30,833
23
61,667
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,834
23
61,668
"Correct Solution: ``` l = [int(input()) for _ in range(3)] print((l[0] + l[1]) * l[2] //2) ```
output
1
30,834
23
61,669
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,835
23
61,670
"Correct Solution: ``` a, b, h= (int(input()) for _ in range(3)) print((a+b)*h // 2) ```
output
1
30,835
23
61,671
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,836
23
61,672
"Correct Solution: ``` a = int(input()) b = int(input()) h = int(input()) print(((a+b)*h)//2) ```
output
1
30,836
23
61,673
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,837
23
61,674
"Correct Solution: ``` a,b,h=(int(input()) for _ in range(3)) print(int((a+b)*.5*h)) ```
output
1
30,837
23
61,675
Provide a correct Python 3 solution for this coding contest problem. You are given a trapezoid. The lengths of its upper base, lower base, and height are a, b, and h, respectively. <image> An example of a trapezoid Find the area of this trapezoid. Constraints * 1≦a≦100 * 1≦b≦100 * 1≦h≦100 * All input values are i...
instruction
0
30,838
23
61,676
"Correct Solution: ``` a,b,h = map(int, [input() for i in range(3)]) print(int((a+b)*h/2)) ```
output
1
30,838
23
61,677