Saif_Qaher's blog

By Saif_Qaher, 10 years ago, In English

HI All , problem from a contest hosted by my university .

here it is (http://a2oj.com/p.jsp?ID=282) .

any idea how to solve it .

thanks .

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Sort problems with operator Less: s2 * d1 < s1 * d2
if we solve p1 first: p1 — s1 * d1 + p2 — s2 * (d1 + d2)
if we solve p2 first: p2 — s2 * d2 + p1 — s1 * (d1 + d2)
open braces.