21744_JourneywithPigs

2022-5-16 18:20| 发布者: Hocassian| 查看: 22| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505810999700-Problem List-采集的数据-后羿采集器.html

Pro.ID

21744

Title

Journey with Pigs

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21744

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    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 n small villages so he decided to earn some money. He tooks n pigs and plans to sell one pig in each village he visits.

    Pork prices in villages are different, in the j-th village the people would buy a pork at pj rubles per kilogram. The distance from town A to the j-th village along the road to town B is dj kilometers.

    Pigs have different weights. Transporting one kilogram of pork per one kilometer of the road needs t rubles for addition fuel.

    Help John decide, which pig to sell in each town in order to earn as much money as possible.

    输入

    The first line of the input file contains integer numbers n (1 ≤ n ≤ 1000) and t (1 ≤ t ≤ 109). The second line contains n integer numbers wi (1 ≤ wi ≤ 109) --- the weights of the pigs. The third line contains n integer numbers dj (1 ≤ dj ≤ 109) --- the distances to the villages from the town A. The fourth line contains n integer numbers pj (1 ≤ pj ≤ 109) --- the prices of pork in the villages.

    输出

    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 n small villages so he decided to earn some money. He tooks n pigs and plans to sell one pig in each village he visits.

    Pork prices in villages are different, in the j-th village the people would buy a pork at pj rubles per kilogram. The distance from town A to the j-th village along the road to town B is dj kilometers.

    Pigs have different weights. Transporting one kilogram of pork per one kilometer of the road needs t rubles for addition fuel.

    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 n (1 ≤ n ≤ 1000) and t (1 ≤ t ≤ 109). The second line contains n integer numbers wi (1 ≤ wi ≤ 109) --- the weights of the pigs. The third line contains n integer numbers dj (1 ≤ dj ≤ 109) --- the distances to the villages from the town A. The fourth line contains n integer numbers pj (1 ≤ pj ≤ 109) --- the prices of pork in the villages.

    Output

    Output n numbers, the j-th number is the number of pig to sell in the j-th village. The pigs are numbered from 1 in the order they are listed in the input file.

    Sample Input

    3 1
    10 20 15
    10 20 30
    50 70 60

    Sample Output

    3 2 1

    Source

    样例输入

    3 1
    10 20 15
    10 20 30
    50 70 60

    样例输出

    3 2 1

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部