diff --git a/taisformula.py b/taisformula.py new file mode 100644 index 0000000..3af1ba5 --- /dev/null +++ b/taisformula.py @@ -0,0 +1,19 @@ +n = int(input()) +prev_t = 0 +prev_v = 0 +total = 0 +for i in range(n): + m = input().split() + t = int(m[0]) + v = float(m[1]) + + if prev_t == 0: + prev_t = t + prev_v = v + continue + + total += ((prev_v + v) / 2) * (t - prev_t) / 1000 + prev_t = t + prev_v = v + +print(total)