基于目前游客的需求,許多導(dǎo)游經(jīng)常帶他們?nèi)ベ徺I一些旅游紀(jì)念品以介紹本土文化和歷史遺跡.一些旅游紀(jì)念品商店會(huì)給帶游客來采購的導(dǎo)游一些傭金以便他們會(huì)帶更多旅客來光顧.傭金的數(shù)額將取決于商品的價(jià)值.為了使導(dǎo)游了解每樣商品為他們帶來的報(bào)酬,這些商店一般上都會(huì)列出每樣物品的價(jià)值以及可獲得的傭金.
假設(shè)一位導(dǎo)游知道每個(gè)游客打算花費(fèi)的數(shù)額以及對他的信任,那么只要不超出本身的預(yù)算,游客就會(huì)購買所有經(jīng)過導(dǎo)游推介的商品.在前往商店前,導(dǎo)游會(huì)開始計(jì)算應(yīng)該推介哪個(gè)商品給哪位游客以便他能獲得最多的傭金.不幸的是,對他而言這是一個(gè)困難的問題因?yàn)樗麖膩砦闯晒τ?jì)算.
幸運(yùn)的是,這位導(dǎo)游遇見了精通于規(guī)劃的你,所以他希望你能幫忙規(guī)劃使這項(xiàng)任務(wù)完成.假設(shè)商店里的每樣商品都有足夠的數(shù)量以滿足所有游客的購物需求.
載入的文件包含多個(gè)測試案例.每個(gè)案例的第一行包含一個(gè)正整數(shù),n以代表打算購買紀(jì)念品的游客數(shù)量.第二行包括多個(gè)整數(shù)n表示每個(gè)游客的最大的預(yù)算(正整數(shù),小于2000).在以下行列有一個(gè)正整數(shù)m(m
英語翻譯
英語翻譯
Currently for the requirement of the sightseers,many cicerones often take them to shopping for some souvenirs in addition to the introduction of the local culture and historic sites.Some souvenir shops give the cicerones who bring sightseers some kickbacks in order to make them bring more.The amount of the kickback is determined by the value of the goods.The shops usually list the values of the goods and the relevant kickbacks for the cicerones to make them clear of the reward they can earn from each kind of goods.
Assume the cicerone has known the maximum amount of money every sightseer intends to spend and the trust of the sightseers on him.The sightseers will buy all souvenirs in any quantity recommended by the cicerone only if their maximum budgets are kept.Before going to the shop,the cicerone starts calculating which goods he should recommend to which sightseer so as to make himself obtain the maximum kickbacks.Unfortunately,this is such a hard problem for him that he never works it out.
Luckily,the cicerone meets you who is good at programming,so he hopes you can program to finish this job.Assume the shop has enough quantity of every goods to meet the shopping requirement of all sightseers.
The input file contains multiple test cases.For each case the first line includes a positive integer n representing the number of sightseers who intend to buy souvenirs.The second line includes n integers each of which is the maximum budget (positive integer and less than 2000) each sightseer plans to spend.There is a positive integer m (m
Currently for the requirement of the sightseers,many cicerones often take them to shopping for some souvenirs in addition to the introduction of the local culture and historic sites.Some souvenir shops give the cicerones who bring sightseers some kickbacks in order to make them bring more.The amount of the kickback is determined by the value of the goods.The shops usually list the values of the goods and the relevant kickbacks for the cicerones to make them clear of the reward they can earn from each kind of goods.
Assume the cicerone has known the maximum amount of money every sightseer intends to spend and the trust of the sightseers on him.The sightseers will buy all souvenirs in any quantity recommended by the cicerone only if their maximum budgets are kept.Before going to the shop,the cicerone starts calculating which goods he should recommend to which sightseer so as to make himself obtain the maximum kickbacks.Unfortunately,this is such a hard problem for him that he never works it out.
Luckily,the cicerone meets you who is good at programming,so he hopes you can program to finish this job.Assume the shop has enough quantity of every goods to meet the shopping requirement of all sightseers.
The input file contains multiple test cases.For each case the first line includes a positive integer n representing the number of sightseers who intend to buy souvenirs.The second line includes n integers each of which is the maximum budget (positive integer and less than 2000) each sightseer plans to spend.There is a positive integer m (m
英語人氣:765 ℃時(shí)間:2020-04-24 03:56:57
優(yōu)質(zhì)解答
我來回答
類似推薦
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 英語翻譯
- 黃岡小狀元數(shù)學(xué)六年級上42頁第6題
- "臺上三分釧,臺下十年攻.”和“____”是一個(gè)道理
- 用C語言寫一程序,要求輸入10個(gè)數(shù),輸出這10個(gè)數(shù)中最大的那個(gè)數(shù),同時(shí)輸出這10個(gè)數(shù)的平均值
- 某名牌連鎖店出售一種會(huì)員卡,花20元購買這種會(huì)員卡后,憑會(huì)員卡在名牌店的任意連鎖店享受折上折優(yōu)惠.
- 高爾夫球的表面為什么有坑
- I remember my daughter used to ask questions that girls__would ask.A.twice her age...
- 有理數(shù)用Q來表示,那無理數(shù)呢?用沒有規(guī)定的符號
猜你喜歡
- 1茶幾面都有哪些材料的
- 2如圖為某有機(jī)物的結(jié)構(gòu)簡式.已知酯類在銅鉻氧化物(CuO?CuCrO4)催化下,與氫氣反應(yīng)得到醇,羰基雙鍵可同時(shí)被還原,但苯環(huán)在催化氫化過程中不變,其反應(yīng)原理如下:在銅鉻氧化物催化下
- 3小明沿著一個(gè)圓形水池的外沿走了一周,正好走了50步,每步的距離約是0.628米,這個(gè)水池的占地面積大約是_平方米.
- 450以內(nèi)12的倍數(shù)
- 5某經(jīng)商銷售一種商品 把它的進(jìn)價(jià)提高40%后作為標(biāo)價(jià) 如果想獲得12%的利潤 問要打幾折?
- 6Some of the things some people,only to miss
- 7數(shù)學(xué)的連比(形如a:b:c),其中a,b,c可以為負(fù)嗎?例如:-1:2:(-3)和-1:2:3.
- 8請高手幫我寫一篇英語短文故事
- 9過y^2=2px(x>0)上一點(diǎn)P(x0,y0)(y0>0)作兩直線分別交拋物線于A(X1,Y1)B(X2,Y2)1)求拋物線上縱坐標(biāo)為0.5p的點(diǎn)到其焦點(diǎn)F的距離2)當(dāng)PA、PB斜率存在且傾斜角互補(bǔ)時(shí)求(y1+y2)/y0的值,并證明直線
- 10我國古代有一位以半部《論語》治天下的名人.他是誰?
- 11fly的現(xiàn)在進(jìn)行時(shí)態(tài)是FLYING嗎
- 12英語 仔細(xì)答題I want to go to Paris where I can learn the French language.