Social Icons

twitterfacebookgoogle pluslinkedinrss feedemail

Monday, August 27, 2012

BUBTPC 2nd Problem H - Reach Office in Time


Reach Office in Time

Problem Description:
Fahad is a job holder. He lives in Mirpur-06. His office is in Motijheel. Everyday he goes from Mirpur to Motijheel through Mirpur10-Faremgat-Motijheel way. There are many options to go to his office. The time and the cost of different options are not the same. For example, there are three ways. The cost and time needed for these ways are:
                    Cost                              Time
300                                                 45 mins            
200                                                 60 mins
30                                                  120 mins           
Fahad’s office starts at 10 A M. Before starting for the office he measures the time he has and the time he needs to go to the office. Then he chooses the one of the options. As a programmer you are invited to write a program to find the options that Fahad can use to go office in time. Also find the best option (Best option is the option by which Fahad can reach office at least 15 minutes before the office starts at a minimum cost).

Input:
The first line of input will contain a number N(1<=N<=10), that will denote the number of sample we will entry. The second line contains the cost and time of each option. This will continue for N times. The third line contains how much time is left to reach office.  Use two dimensional arrays for the program.

Output: 
The output shows two things. This shows the available options to reach the office in time with the respective costs. In case of more than one option, this will also show the best option.

Sample Input/Output:
Sample Input
Sample Output
3

45        60        120
300      200       30
TIME TO LEFT: 100
OPTIONS TO REACH OFFICE TIMELY ARE:
45       60
300     200
Best Option:
60     200

Problem setter: Md. Saifur Rahman, Asst. Professor, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)

BUBTPC 2nd Problem G - Do You Have Enough Money?


Do You Have Enough Money?

Problem Description:
Riad is a student of BUBT. His hobby is shopping. When he goes for shopping he wants to buy whatever he sees. He always forgets how much money is in his hand. To overcome this problem he has decided to write a program that will read the amount of money he has and the prices of the items he wants to buy. Determine whether he has enough money to buy everything he selected or whether he is in short of money. If he does not have enough money, the program will indicate the amount of the shortfall.  In case of short of money the program also indicates the list of items he may buy with his money.

Input:
The first line contains a single integer N, which will denote the amount of money he has in his hand. The second line contains M(1<=M<=10) that indicates the number of items Riad is interested to buy. The third line contains price of each element that Riad is interested to buy.

Output:
In output there will be two lines. The first line shows whether Riad has enough money or not (print BUY ALL ITEM or SHORTFALL depending on the money in his hand). In case of shortfall print the amount of shortfall. The second line contains the list of items that Riad may buy in case of shortfall.

Sample Input/Output:
Sample Input
Sample Output
100
4
25   60  75  70

1000
5
25  60  100   85    50
SHORTFALL Tk: 130
YOU MAY BUY
75   25

BUY ALL ITEMS


Problem setter: Md. Saifur Rahman, Asst. Professor, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)

BUBTPC 2nd Problem D - Calculate the Percentage



Calculate the Percentage

Problem Description:
Rakib and the other students in his class find the programming class boring because their teacher can not make the programming class interesting. Now all the students in the class want to do something about programming class teacher. Never the less they are agree to learn programming with much interest and this leads them to write an application to their head of the department to change their teacher, Moreover most of the students failed in the last programming exam. But to write that application, they need to write the percentage of failure in the application. As they are not good in programming they don’t know how to calculate the percentage. So they have come to you to write a computer program to calculate the percentage of the students failed in the exam.

Input:
The first line of input contains one number N (2<=N<=1000) which is the number of students in the class and the second line contains M (30<=M<=70). M is the mark to pass the exam. Next line will contain N space separated integers within 0 to 100 denoting the obtained mark of N students in the exam.

Output:
For the given input you need to output the percentage of students failed in the exam.  See the sample output for more details.

Sample Input/Output:
Sample Input
Sample Output
4  
45
20 60 40 10

5  
40
85   75   35   50   38
Percentage of students fail to pass the exam: 75



Percentage of students fail to pass the exam: 40


 
Problem setter: Abu Obaida Opu, Dept. of CSE 
Bangladesh University of Business and Technology (BUBT)
 

Sample text

Sample Text