o = '' while gets t = $_.to_i while t>0 v=gets.to_f o << (v < 0 || v != (w = v.to_i) ? "Invalid input" : ((w-2)*180).to_s) o << 10 t-=1 end end puts o