Java small coding

Job ID: 34641922

Budget: $20 – $40 CAD

I need an urjent solution to a Java problem. I am posting the question below. Please go through it and let me know if you can solve it.

Write a program that suggests distribution of warehouse inventory quantities of one product to stores. Warehouse and stores have some inventory of the product, measured in units. Each store has a name, a minimum number of units, and a desirable number of units it needs to have. The program should suggest how many units of the warehouse inventory should be sent to each store. The total count of units sent cannot be more than the warehouse inventory. You should follow these rules:

• If warehouse has sufficient inventory, each store should get such a shipment that its total inventory becomes equal to the desirable number of units.

• If inventory is not sufficient for this, each store should get such a shipment that its total inventory becomes equal to the minimum number of units, and the remaining warehouse inventory needs to be distributed between stores “fairly”. This means that the “luckiest” store (the store with maximum ratio between inventory and desirable inventory) and the “unluckiest” store (the store with the minimum ratio) should have the least possible difference of these ratios. In case two distributions have the same “fairness”, you should give preference to stores in alphabetical order of their names.

• If inventory is not sufficient to satisfy even minimums for all stores, it should be distributed “fairly” using the same approach, except the “fairness” ratio should be between inventory and minimum inventory

Input:
Line 1: two integers: number of stores (1 or more) and warehouse inventory (0 or more), comma-separated.
Following lines, one per store: store name, and three integers: store inventory (0 or more), minimum inventory (0 or more), and desired inventory (minimum or more), comma-separated.

Output:
One line per store: store name, inventory to send to this store from warehouse (1 or more), comma-separated.
In case program decides no to send any inventory, output a single line “No shipments”



Example input:
2,2
Store1,2,3,5
Store2,4,4,4

Example output:
Store1,2

Explanation: Store2 has no additional inventory need: it has 4 units, which is the same as the desired inventory. Store 1 requires 3 more units to get from the current inventory 2 to the desired inventory 5, but warehouse has only 2 units, thus Store1 will get 2 units.


Please let me know if anybody can solve this.
This will not take more than an hour for someone who is expert in Java.