W.C 4.3 Mr Stark

Mr. Stark is the owner of Stark industries, a manufacturer of weaponry.

A local Mafia group has hijacked one of the factories in the desert.

The mafias want to transport the weapons from the factory to their base camp, and use
a single truck to do it.

But, every kilometer the truck travels with the weapons, one weapon falls off and
breaks. The truck can only travel integral values of distance, and will lose 1 weapon for
every km travelled.

The weapons can be unloaded at any point from the truck, and can be picked up again

Given the number of weapons X, max capacity of the truck Y and distance between the
factory and the base Z, find the maximum number of weapons that can be transferred
intact from the factory to the mafia base.

Sample testcase:

10 5 5

Testcases :

500 1000 100

200 100 125

3000 1000 1000


Submit final as average of all answers(excluding sample testcase)

This challenge is worth 60 points.

You must be logged in to submit a solution

View ranklist for this challenge
About scoring and submission

Contact Us

Kunal Desai : 7715051136

Neelraj Patil : 9930671144

Privacy Policy