Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Journey with Pigs
Description Farmer John has a pig farm near town A. He wants to visit his friend living in town B. During this journey he will visit Pork prices in villages are different, in the j-th village along the road to town B is d kilometers._{j}Pigs have different weights. Transporting one kilogram of pork per one kilometer of the road needs Help John decide, which pig to sell in each town in order to earn as much money as possible. Input The first line of the input file contains integer numbers w ≤ 10_{i}^{9}) — the weights of the pigs. The third line contains n integer numbers d (1 ≤ _{j}d ≤ 10_{j}^{9}) — the distances to the villages from the town A. The fourth line contains n integer numbers p (1 ≤ _{j}p ≤ 10_{j}^{9}) — the prices of pork in the villages.Output Output Sample Input 3 1 10 20 15 10 20 30 50 70 60 Sample Output 3 2 1 Source Northeastern Europe 2007, Northern Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator