def lscan; gets.split.map(&:to_f); end def bye(msg); puts msg.to_s; exit; end a,b,c,d = lscan i = 2.0 j = -(a+c) k = -(b+d) q = j*j-4.0*i*k bye 'No' if q < 0 bye 'Yes' if q.abs < 1e-9 # https://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1147987886 p [(a+c)/2,(b+d)/2]*' '