Month: November 2012

3rd BUBT Intra-University Programming Problem J

Problem J
        Profit-Loss
Problem Statement:
Kamal is the only son of Mr. Zamal. Kamal has recently completed his graduation, but he is very much relaxed to get a job. So, Mr. Zamal established a super store for him where Kamal can sell all the grocery, fashion, toiletries and garment items. Since, Kamal is careless about calculating profit and loss for all the sold products, Mr. Zamal requests you to write such a program which can find out  percentage of profit/loss for a sold product.
Input:
The first line denotes number of test case.  The second line contains a number X  (1<=N<=<32000) denotes purchase price of a product.  The third line contains number M  (1<=M<=<32000) denotes sold price of that specific product. 
Output:
Output contains according to the number of the test cases. Shows “Profit/loss: X%”, where X is the percentage of profit or loss.
Sample Input/Output:
Sample input
Sample output
2
100
75
3000
3200
Loss:25%
Profit: 6.6%
______________________________________________________________________________
Problem Setter: Md. Mijanur Rahman, Asst. Professor, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem I

Problem I
Mathematics for Jane
Background Story
Steven and Grace want to teach basic Mathematics to their baby daughter, Jane.
Grace bought “flash cards” that contains one or more dots.
Here are some examples of those cards:
Card 1:     Card 2:     Card 3:
——-     ——-     ——-
|     |     |   * |     |*  * |
|  *  |     |     |     |    *|
|     |     | *   |     |*  * |
——-     ——-     ——-
Card 1 is actually number 1, Card 2 is number 2, Card 3 is number 5.

The creator of these flash cards claims that babies can spot the number of dots faster than adults.
Problem Description
The issue here is that my wife Grace only bought N such cards, and some of them are the same.
Steven wants to teach more numbers to Jane…
Suddenly Steven realizes that he can actually combine two cards to produce a new number!!
For example, if Steven combines Card 1 and Card 3, he can teach Jane number: 1+5 = 6 :).
Being a computer scientist, Steven wonders, how many different numbers that he can teach to Jane by using single card and also by combining two cards?
Input
For each test case there are two line. First line contain one integer, N (1 <= N <= 20), that denotes the number of flash cards bought by Grace. Then next line contain Npositive integers less than 100 that denote the number of dots on each flash card. These N flash cards are not necessarily unique as described in the problem description above.
Output
For each test case, print an integer in one line to answer Steven’s question above.
Sample Input
Sample Output
4  
1 1 1 1
3  
1 2 5
2  
10 1
2  
1 1
1
7
2
6
3
2
1
______________________________________________________________________________
Problem Setter: Dr. Steven Halim, Lecturer
NATIONAL UNIVERSITY OF SINGAPUR (NUS)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem H

Problem H
Find the Summation
Input: standard input   Output: standard output
Problem
Professor Edward is very angry with his students, because they have not completed his home task. As a result, he boycotts the classroom. Students realize their wrong. They go to the professor’s room and acknowledge their fault. Professor Edward give the students one condition : If they can find the summation of a series, then he will return to the classroom. The series is:
S=∑_(K=0)^N 〖(2K+6K^2)〗

You will be given N, find the summation of this series as soon as possible.
Input
The first line of input will contain an integer T(1<=T<=10)that will determine the number of test cases. Each case starts with one integer N(1<=N<=100).
Output
For each test case, output the line “Case #x: S“, where x is the number of the test case, S is the summation of the series.
Sample Input:
3
1
5
16
Sample Output:
Case #1: 8
Case #2: 360
Case #3: 9248
______________________________________________________________________________
Problem Setter: Forhad Ahmed, ACM ICPC World Finalist, 2012
Shahjalal University of Science and Technology (SUST)
Special Thanks: Mahfuzur Rahman           
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem F

Problem F
Summation of Digits of Number
Input: standard input   Output: standard output
The Problem:
Fahad and Zihad are two brother. Fahad read CSE program. Zihad pass H.S.C and waiting for admission.  Zihad wants to be a electrical engineer. But his father and mother wants that zihad will be a computer scientist. Fahad realize the mater and decide that he will write some interesting program for his brother so that he becomes interest for study computer science. From this point of view he wants to write a program that will take an integer number as input and calculate the sum of its digits as output. 
Input
Input will contain an integer number N (1<=N<=  – 1).
Output
For each input, output the summation of each digit of the number N.
Sample Input
142
36
1208
Sample Output
7
9
11
______________________________________________________________________________
Problem Setter: Mijanur Rahmann, Lecturer, Dept. of CSE

Bangladesh University of Business and Technology (BUBT)

At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem G

Problem G
Salary Report
Input: standard input   Output: standard output
Problem
Nahid, Suhel and Eather are three friends. They are also working to make a global platform for students’ community, ‘www.unicampuz.com’. They decide to do some campaign in different universities to let other students known about unicampuz. But, they don’t have sufficient money to do this. They decide to do outsourcing. They choose that name of their team is ‘codesum’. There have few programmers in codesum. But, a problem arises. Everyone is not working equally. So, admin decide to make salary system based on hour. So, they hire you to help them to know their Salary after M month.
Input
For each test case there is four line input. The first line contain an integer N (1<=Dn<=100) enotes number of employee. The second line contains an integer M (0<=M<=12) denotes total month that we want to calculate. The third line contain a decimal number R (0<=R<=500) represent ret per hour. Finally the forth line contain N different integer number that represent the hour employee works respectively.
Output
The output will print the salary of each employee in a single line.
Sample Input
Sample Output
5
2
200.50
80   70    85    15   0
4
3
150.25
100   90    75    55   20
34085     32080     28070      6015     0



______________________________________________________________________________
Problem Setter: Iftekhar Ahmed Eather, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem E

Problem E
Ball Passing Game
Input: standard input   Output: standard output
The Problem


In this game there are two players Player-1and Player-2 and a certain round N. Before the start of the game which player starts the game will be told.
Say, player Player-1 starts the game and passes ball to player Player-2  and then player Player-2 passes the ball to player Player-1 and this process is continued for a certain round N.
You have to find out which player will have the ball after N rounds.


Input
There are two inputs in each line. The first input is a number (1 or 2) represents which player will start the game. The second input is an integer N represents how many rounds to be played.
Output
Your program should output a line containing which player will have the ball after N rounds. As shown in the sample output.
Sample Input
1   5
2   5
1   4
Sample Output
Player-2 will have the ball after 5 rounds.
Player-1 will have the ball after 5 rounds.
Player-1 will have the ball after 4 rounds.
_______________________________________________________________________
Problem Setter: Md. Joshim Uddin, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem D

Problem D
Bangladesh versus India
Problem
Recently Bangladesh Cricket Team has become more strong and confident than before. One day match of Bangladesh versus India always becomes exciting.
            How do you feel when Bangladesh Team wins? Obviously you feel proud, don’t you?
As you all are the beginner programmer so your task is so easy. You have to output the summery –scoreboard where the input is the individual score of two-team players.
Input
Input will consist of two lines. First line represents the individual score of Bangladeshi players maintaining sequence of player-1, player-2, player-3…….player-11.Similarly second line for Indian team. Assume that if a player does not have batting-performance then his score will be considered 0.
Output
The output will contain three lines. The first line contains the name of winner team. The second line represents the number of half-century obtainer and the third line represents number of century obtainer.
Sample Input
56  62  12  0  33  2  7  6  123  0  8
51  0  106  12  44  0  3  12  0  0  25
Sample Output
Winner Team : Bangladesh
Half-Century Scorer :   3
Century Scorer :   2
______________________________________________________________________________
Problem Setter: Md. Abdul Alim, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem C

Problem C
Shopping
Input: standard input   Output: standard output
Problem
Nishy is a girl of 15 years. For the upcoming EID festival she wants to go for shopping. For the shopping she has a certain amount of money and she makes a price list of items. Her brother is a computer programmer. So, she asked her brother to write a program for her that will give a message if she can buy all the items within the amount she has or not.
Input
In each case, there is three lines of input. First line contain one integer T (1<=T<=31000) represents the total amount and the second line contain N (1<=N<=100) is the number of items. Next the third line contains N different integers representing the prices of the items.
Output
Output should contain a message for each case. If she can buy all the items, print Go for shopping, if not print You don’t have enough money without the quotes.
Sample Input
100
5
10 20 30 20 10
100
1
500
Sample Output
Go for shopping
You don’t have enough money
______________________________________________________________________________
Problem Setter: Md. Joshim Uddin, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem B

Problem B
Birthday Lights
Input: standard input   Output: standard output


The Problem
Kabir vai is a great programmer. He is invited to a birthday function. But he started to feel boring. The place was decorated with small lights which were blinking and changing colors with each blink. At the first blink a light colored green, then blue with next blink, then red and yellow at last. See the sequence:
Green=>Blue=>Red=>Yellow.


Kabir vai started to count the blinks and at a certain count he suddenly stopped. Can you tell which color was on the light then?
Input
Input will contain an integer N, 1<=N<=  – 1, (number of blinks Kabir vai counted) in each line.
Output
For each input, output which color is on the light in a line. See sample input and output below.
Sample Input
1
2
8
Sample Output
Green
Blue
Yellow
______________________________________________________________________________
Problem Setter: Md. Hasan Shahriar, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments

3rd BUBT Intra-University Programming Problem A

Problem A
BIG INTEGER
Input: standard input   Output: standard output
Moni is a little girl and just learning how to count and write numbers. She randomly writes different numbers in her notepad. But her parents are in a great trouble, because moni randomly select two numbers from his book and ask her parents to tell him which is bigger.
Input
Input will contain several test cases. Each test case will contain two integers in two separate lines. The range of numbers is between -31000 to 31000.
Output
For each input, output the larger one between the two integers. If both are equal, print any of them.
Sample Input
2
5012
31587
9999
999 
Sample Output
31587
9999
______________________________________________________________________________
Problem Setter: Md. Hasan Shahriar, Dept. of CSE
Bangladesh University of Business and Technology (BUBT)
At First you can try to solve this problem if you can’t than see this code & find what’s your problem . If you copy paste this code you could not improve yourself in programming .
Posted by Shipu Ahamed in Contest, 0 comments