19572번 – 가뭄(Small)

1

문제

https://www.acmicpc.net/problem/19572

풀이

코드

import math
d1, d2, d3 = map(int, input().split())

def intJoin(arr):
  return " ".join([int(i) for i in arr])

def answer():
  a = (d1+d2-d3)/2
  c = d2-a
  b = d3-c
  if min(a, b, c) <= 0:
    print(-1)
    return
  a, b, c = (round(a, 2), round(b, 2), round(c, 2))
  print(1)
  print(" ".join([str(a), str(b), str(c)]))
  
answer()

Add Comment