Question: TO BE CODED IN C + + Mitsuha is traveling to Tokyo to meet Taki Tachibana. She plans to prepare Itomori's best sushi for him,

TO BE CODED IN C++
Mitsuha is traveling to Tokyo to meet Taki Tachibana. She plans to prepare
Itomori's best sushi for him, which requires three main ingredients: Bread (B), Salmon
(S), and Corn (C). She expresses her favourite recipe as a string, such as "BBSCS",
meaning Bread, Bread, Salmon, Corn, and Salmon.
Mitsuha has nb pieces of bread, ns pieces of salmon, and nc pieces of corn in her kitchen.
The nearby shop offers all three ingredients (unlimited supply) at prices pb yen for bread,
ps yen for salmon, and pc yen for corn.
With r yen to spend, what is the maximum number of sushi plates she can prepare,
assuming she cannot break or slice any ingredients?
Input:
Recipe: a string containing only letters B,S,C such that len(string)100
1nb,ns,nc100
1pb,ps,pc100
1r1012
Example 1:
Recipe: BBBSSC
n-b=6,n-s=4,n-c=1
p-b=1,p-s=2,p-c=3
r=4
Output: 2
 TO BE CODED IN C++ Mitsuha is traveling to Tokyo to

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

I have opened the image but ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!