Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

### Logarithmic's blog

By Logarithmic, history, 3 years ago, ,

I faced this problem. I dont know how to formulate this as min cost flow problem:

A rental company uses cars which it leases from manufacturers. The company has a requirement of cars for the next 6 months as follows: Mar: 43 Apr: 41 May: 44 June: 39 July: 42 Aug: 45

The company can lease cars for the following costs and lengths of time: a 3-month lease for $1700, a 4-month lease for$2200, a 5-month lease for \$2600. The company can undertake a lease beginning in any month. On March 1 the company has 20 cars on lease, all of which go off lease at the end of April.Formulate the problem of determining the most economical leasing policy as a mincost flow problem.

• 0

By Logarithmic, history, 3 years ago, ,

Given a range (l, r) where 0.0 <= l,r <= 1.0 we want to find a fraction x/y which satisfies following condition: l <= x/y < r and y should be as small as possible. l and r might have at most 9 digits after floating point.

• +18

By Logarithmic, history, 3 years ago, ,

Given 3 points of triangle, one of them is origin, coordinates of the other 2 are positive integers. I want to find the leftmost point inside triangle(could be on the edges of triangle). x_i, y_i <= 10^9. Is there any algorithm to solve this problem?