0% found this document useful (0 votes)
4 views44 pages

Outsbook Problem List

The document contains descriptions of 122 programming problems involving calculations with integers. Each problem provides sample input/output, and the goal is to write Python code to solve the described calculations.

Uploaded by

Shariful Asgar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views44 pages

Outsbook Problem List

The document contains descriptions of 122 programming problems involving calculations with integers. Each problem provides sample input/output, and the goal is to write Python code to solve the described calculations.

Uploaded by

Shariful Asgar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Programming Problem

101 – Income:
A persons's daily income is X taka. What is her income in one
year. Solve this problem using python program .

Example:
if X = 216 then
In one year the income of the person is 78840 taka.
The Input
The input file contains one integer number X (X<=300).

The Output
Output will show the one integer numbers in a separate line.

Sample Input
216

Sample Output
78840

102 – Divisor:
In a division problem, the dividend is D, the quotient is Q and
the remainder is R. What is the divisor?

Example:
if D = 16, Q = 5 and R = 1 then
Divisor is 3
The Input
The input file contains only 3 integer
numbers D, Q and R (D<=4000, Q<100 and R<20).

The Output
Output will show the one integer numbers in a separate line.

Sample Input
16 5 1

Sample Output
3

103 - Mina and Rina:


Mina and Rina together have X taka. Mina has Y taka more
than Rina. What amount of money does Mina and Rina each
have.

Example:
if X = 7532, and Y = 560 then
Mina has 4046 taka and Rina has 3486 taka.

The Input
The input file contains only 2 integer
numbers X and Y (X<=10000 and Y<4000).

The Output
Output will show the two integer numbers first one
is Mina's and second one is Rina's taka which is seperate by
space in a separate line.

Sample Input
7532 560

Sample Output
4046 3486
104 – Ages:
The sum of ages of a father and
his daughter is X years. Father's age is four times the age of
the daughter. What are their ages ?

Example:
if X = 80 then
Father's age is 64 years and daughter's age is 16 years.

The Input
The input file contains only 1 integer number X (X<=10000).

The Output
Output will show the two integer numbers first one
is father's and second one is daughter's age which is seperate by
space in a separate line.

Sample Input
80

Sample Output
64 16

105 - Book Price:


The Problem
The price of 7 books is X taka, what is the price of M books ?

Example:
if X = 623 and M = 15 then
price of 15 books is 1335.

The Input
The input file contains only 2 integer
numbers X and M (X<=10000 and M<30).

The Output
Output will show the one integer number which is the price
of M book in a separate line.

Sample Input
623 15

Sample Output
1335
106 - Hostel Meal:
The Problem
In a hostel there is food for X students for M days. If Y new
students arrive, how long will the food last ?

Example:
if X = 40, M = 20 and Y = 10 then
food will last 16 days

The Input
The input file contains only 3 integer
numbers X ,M and Y (X<=1000, M<365 and Y<=1000).

The Output
Output will show the one integer number which is the days food
will last in a separate line.

Sample Input
40 20 10

Sample Output
16

107 - Excavate Pond:


X persons need D1 days to excavate a pond. How many
additional persons must be employed if the pond is to be
excavated in D2 days ?

Example:
if X = 200, D1 = 15 and D2 = 10 then
100 additional persons must be employed.
The Input
The input file contains only 3 integer
numbers X , D1 and D2 (X<=1000, D1<=365, D2<=365
and D2 < D1).

The Output
Output will show the one integer number which is additional
persons must be employed in a separate line.

Sample Input
200 15 10

Sample Output
100

108 – Dividend:
In a division problem, the divisor is D, the quotient
is Q and the remainder is one-third of the divisor. What is the
dividend ?

Example:
if D = 3 and Q = 5 then
Dividend is 16
The Input
The input file contains only 2 integer numbers D,
and Q (D<=4000, Q<100).

The Output
Output will show the one integer numbers in a separate line.

Sample Input
35

Sample Output
16

109 - Average Age:


The ages of Maria, Mithun, Mac, Moni and Mala are
respectively Y1, Y2, Y3, Y4 and Y5 years. What is their average
age ?

Example:
if Y1 = 10, Y2 = 12, Y3 = 13, Y4 = 11 and Y5 = 14 years then
Average age is 12 years.

The Input
The input file contains only 5 integer numbers Y1, Y2, Y3,
Y4 and Y5 (Y1, Y2, Y3, Y4, Y5<=30).
The Output
Output will show the one integer number which is the average
age in a separate line.

Sample Input
10 12 13 11 14

Sample Output
12

110 - Average Run:


In a test series of five cricket matches, the average of the runs
made by six batsmen of the visiting team was R1; the average
of the runs made by four bowlers was R2. What average run did
those players make in that series ?

Example:
if R1 = 76, and R2 = 21 then
Players of the visiting team made 54 runs on average in that
series.

The Input
The input file contains only 2 integer numbers R1 and R2 (R1,
R2<=200).

The Output
Output will show the integer number which is the average run
of visiting team seperate by space in a separate line.

Sample Input
76 21

Sample Output
54

111 - Father Age:


The average age of two children and their father is X years.
The average age of these children and their mother
is Y years. Mother's age is M years; what is the father's age?

Example:
if X = 17, Y = 13, and M = 25 then
Father's age is 37 years.

The Input
The input file contains only 3 integer numbers X, Y, M (X, Y,
M<=50).

The Output
Output will show the one integer numbers which is father's age
in a separate line.

Sample Input
17 13 25

Sample Output
37

112 - Barahatia Village:


The population of Barahatia village is X. P% of the population
of that village is educated. Find the number of educated
persons.

Example:
if X = 1280, and P = 40 then
512 persons are educated.

The Input
The input file contains only 2 integer numbers X, P (X < 10000,
P<=100).

The Output
Output will show the one integer numbers which is educated
persons in the village in a separate line.

Sample Input
1280 40

Sample Output
512

113 - Profit Percentage:


A book is bought for X taka and sold for Y taka. What is the
percentage profit ?
[Note: here Y > X]

Example:
if X = 50, and Y = 55 then
The percentage profit is 10 taka.
The Input
The input file contains only 2 integer numbers X, Y (X <
10000<= Y <= 30000).

The Output
Output will show the one integer numbers which is
profit percentage in a separate line.

Sample Input
50 55

Sample Output
10

114 - Loss Percentage:


A book is bought for X taka and sold for Y taka. What is the
percentage loss ?
[Note: here X > Y]

Example:
if X = 50, and Y = 46 then
The percentage loss is 8 taka.

The Input
The input file contains only 2 integer numbers X, Y (Y < 10000
<= X <= 30000).

The Output
Output will show the one integer numbers which is loss
percentage in a separate line.

Sample Input
50 46

Sample Output
8

115 - Annum Interest:


The rate of interest is P% per annum. What is the interest
on X taka for Y years ?

Example:
if P = 7, X = 800, and Y = 5 then
The interest is 280 taka.

The Input
The input file contains only 3 integer numbers P, X, Y (P <
100, X < 10000, Y < 30).

The Output
Output will show the one integer numbers which is the interest
in a separate line.

Sample Input
7 800 5
Sample Output
280

116 - Interest Rate:


Mr. Nezam deposited X taka in a bank and in Y years
got I taka as interest.What is the percentage rate of interest
per annum ?

Example:
if X = 500, Y = 3, and I = 105 then
The percentage rate of interest is 7 taka per annum.

The Input
The input file contains only 3 integer numbers X, Y, I (X <
10000, Y < 30, I < 40000 ).

The Output
Output will show the one integer numbers with percentage sign
(%) which is the percentage rate of interest per annum in a
separate line.
[Note: Don't forget to put % sign after the integer value]

Sample Input
500 3 105

Sample Output
7%
117 - Principal Amount:
The rate of interest being P% what amount of money will
earn I taka as interest in Y years ?

Example:
if P = 8, I = 240, and Y = 5 then
600 taka will earn

The Input
The input file contains only 3 integer numbers P, I, Y (P <
100, I < 40000, Y < 30).

The Output
Output will show the one integer number which is the principal
amount in a separate line.

Sample Input
8 240 5

Sample Output
600

118 - Barahatia Village (II):


Increasing by P% the population of Barahatia village
became X. What was the previous population of the village ?

Example:
if P = 5 and X = 2100 then
Previous population of the village 2000.
The Input
The input file contains only 2 integer numbers P, X (P<100, X <
10000).

The Output
Output will show the one integer numbers which is previous
population of the village in a separate line.

Sample Input
5 2100

Sample Output
2000

119 – Pass:
In an examination out of X students Y failed, What percentage
of students passed in that examination ?

Example:
if X = 40 and Y = 4 then
percentage of passed 90%
The Input
The input file contains only 2 integer
numbers X, Y (X<1000, Y < 500, X >= Y).

The Output
Output will show the one integer numbers which is percentage
of passed students in a separate line.

Sample Input
40 4

Sample Output
90%

120 - Increase of Population:


In Bangladesh every year X persons are born and Y persons
die, for every one thousand of the population. What is the
percentage rate of increase of population in a year?

Example:
if X = 25 and Y = 15 then
Increase rate 1%
The Input
The input file contains only 2 integer
numbers X, Y (X<1000, Y < 1000, X >= Y).

The Output
Output will show the one integer numbers which is percentage
rate of increase of polulation in a separate line.

Sample Input
25 15

Sample Output
1%

121 – Quotient:
Dividing a number by X1, the quotient is Q1 and the remainder
is R1. What will be the quotient Q2 and remainder R2 when
the number is divided by X2 ?

Example:
If X1 = 54, Q1 = 18, R1 = 50 and X2 = 73 then
the quotient is Q2 = 14, and remainder R2 = 0
The Input
The input file contains 4 integer numbers X1, Q1,
R1 and X2 (X1, Q1, R1, X2<1000).

The Output
Output will show two integer numbers which
are quotient Q2 and remainder R2 seperated by space in a
separate line.

Sample Input
54 18 50 73

Sample Output
14 0

122 - Save Money in Bank:


Mr Nezam monthly pay is T taka. Every month he
spends X taka on house rent and Y taka on household
expenses. The remaining money he saves in a bank. What
amount of money does Mr. Nezam save in a year ?

Example:
if T = 50000, X = 20000 and Y = 25000 then
Save money in a year 60000 Taka

The Input
The input file contains only 3 integer
numbers T, X, Y (T<100000, X<50000, Y < 50000).

The Output
Output will show the one integer number which amount of
money does Mr. Nezam save in a year in a separate line.
Sample Input
50000 20000 25000

Sample Output
60000 Taka

123 - Writing Pad:


The price of D dozen writing pads is X taka, what is the price
of Y writing pads ?

Example:
if D = 10, X = 11760 and Y = 7 then
The price of 7 writing pads 686 Taka

The Input
The input file contains only 3 integer
numbers D, X, Y (D<100, X<50000, Y < 500).

The Output
Output will show the one integer number which the price
of Y writing pads in a separate line.

Sample Input
10 11760 7

Sample Output
686 Taka

124 - Rice Crop:


P1 persons can harvest the crop of a piece of land in D1 days.
In how many days will P2 persons harvest that crop ?

Example:
if P1 = 11, D1 = 30 and P2 = 22 then
15 Days

The Input
The input file contains only 3 integer numbers P1, D1, P2 (P1,
D1, P2<1000).

The Output
Output will show the one integer number which the days
will P2 persons harvest that crop in a separate line.

Sample Input
11 30 22

Sample Output
15 Days

125 - Hostel Meal (II):


In a hostel S1 students have food for D1 days.
After D2 days S2 more students joined the hostel. How many
days will the ramaining food last ?

Example:
if S1 = 500, D1 = 50, D2 = 10 and S2 = 300 then
food will last 25 days
The Input
The input file contains only 4 integer numbers S1, D1, D2, S2 (S1,
D1, D2, S2<=1000).

The Output
Output will show the one integer number which is the days food
will last in a separate line.

Sample Input
500 50 10 300

Sample Output
25 days

126 - Chair and Table:


The price of X chairs and Y tables totals T taka. The price of
one chair is T1 taka; what is the price of one table ?

Example:
if X = 5, Y = 2, T = 5945 and T1 = 789 then
the price of one table 1000 taka
The Input
The input file contains only 4 integer numbers X, Y, T, T1 (X, Y <
100 and T, T1 <=100000).

The Output
Output will show the one integer number which is the price of
one table in a separate line.

Sample Input
5 2 5945 789

Sample Output
1000 Taka

127 - Victory Day:


Proma, Rimi and Monisha made X flags to decorate the school
on Victory Day. It was found that Proma had made X1 more
flags than Rimi, again Monisha had X2 more flags than Proma.
How many flags did each one of them make ?

Example:
if X = 100, X1 = 10, and X2 = 5 then
Proma 35, Rimi 25, Monisha 40

The Input
The input file contains only 3 integer numbers X, X1, and X2 (X,
X1, X2 < 1000).

The Output
Output will show the 3 integer numbers which is the flags
of Proma, Rimi and Monisha in a separate line.

Sample Input
100 10 5

Sample Output
Proma 35, Rimi 25, Monisha 40

128 - Twice Number:


If X is added to twice a number, the sum will be S. What is the
number?

Example:
if X = 6 and S = 14 then
The number is 4.

The Input
The input file contains two integer numbers X (X<=300)
and S (S<=500).

The Output
Output will show the one integer numbers in a separate line.

Sample Input
6 14

Sample Output
4

129 - Subtracted Number:


If X is subtracted from a number, the difference will be D.
What is the number?

Example:
if X = 5 and D = 11 then
The number is 16.
The Input
The input file contains two integer numbers X (X<=300)
and D (D<=1000).

The Output
Output will show the one integer numbers in a separate line.

Sample Input
5 11

Sample Output
16

201 - Motu and Patlu:

The Problem
Mr. Rahim is a rich man. He has many Orange gardens. Now it is
the time to harvest. He has two very faithful servants
named “Motu" and "Patlu”. So he ordered them to collect the
oranges. Both go to gardens separately and collect oranges,
whole day and returns at evening. But Mr. Rahim is very weak
at Math. Now your job is to write a program by which Mr.
Rahim can easily find the amount of
oranges Motu and Patlu collected together.

The Input
Input will consist of two number a and b denoting the amount
of Motu’s orange and Patlu’s orange and they are not greater
than 1000.

The Output
Output will show the total amount of orange collected
by Motu and Patlu in a separate line.

Sample Input
440 200

Sample Output
640

Volume 2
201 - Motu and Patlu:

The Problem
Mr. Rahim is a rich man. He has many Orange gardens. Now it is
the time to harvest. He has two very faithful servants
named “Motu" and "Patlu”. So he ordered them to collect the
oranges. Both go to gardens separately and collect oranges,
whole day and returns at evening. But Mr. Rahim is very weak
at Math. Now your job is to write a program by which Mr.
Rahim can easily find the amount of
oranges Motu and Patlu collected together.
The Input
Input will consist of two number a and b denoting the amount
of Motu’s orange and Patlu’s orange and they are not greater
than 1000.

The Output
Output will show the total amount of orange collected
by Motu and Patlu in a separate line.

Sample Input
440 200

Sample Output
640

202 - HELP!!!!!HELP!!!!!!:

The Problem
I think we all know basic rules of multiplying two
numbers. Diya and Hiya has just learned how to multiply two
numbers. So they are practicing very hard to get the Mastery on
it. So they need a small computer program to help them. The
program will give the multiplied product of two given integers.
The Input
Input Consists of only two numbers a and b (a,b<100).

The Output
Output will show the multiplied value of a and b in a separate
line.

Sample Input
15 5

Sample Output
75

203 – Diffy:

The Problem
Make a simple program that reads two variables named A, B.
Calculate and print the difference of A and B (A - B).
The Input
The input file contains 2 integer numbers A and B (A<1000
and B<1000).

The Output
Output will show the difference of A and B in a separate line.

Sample Input
200 50

Sample Output
150

204 - Multi Diffy:

The Problem
Make a simple program that reads four variables named A, B,
C, D. Calculate and print the difference between multiplication
of A, B and multiplicaiton of C, D (A * B - C * D).
The Input
The input file contains 4 integer numbers A, B,
C, and D (A<1000, B<1000, C<1000 and D<1000).

The Output
Output will show the difference of A * B and C * D in a
separate line.

Sample Input
10 4 5 2

Sample Output
30

205 - Mr. Ant’s Confusing Sum:

The Problem
Mr. Ant add two numbers in an interesting way. He adds two
numbers such as
1+2=2
2+2=4
3+3=9
4 + 4 = 16

One day Mr. Ant’s friend Miss. Butterfly came for a visit at Mr.
Ant’s home. Mr. Ant asked Miss Butterfly can you add two
numbers. She became confuse, can you help Miss. Butterfly with
this?

The Input
The input file contains 2 integer numbers A and B (A<300
and B<300).

The Output
Output will show the confusing sum of A and B in a separate
line.

Sample Input
25 30

Sample Output
750

206 - Subtraction Sum:

The Problem
Make a simple program that reads four variables named m, n, o,
p. Calculate and print the sum of subtraction of m, n and
subtraction of o, p.
The Input
The input file contains 4 integer numbers m, n,
o, and p (m<1000, n<1000, o<1000 and p<1000).

The Output
Output will show the SUM of m - n and o - p in a separate line.

Sample Input
10 4 5 2

Sample Output
9

207 – Car:

The Problem
There is a simple programming task in front of you. You will be
given initial velocity(u) of a car , acceleration(a) and elapsed time(t).
You have to find the final velocity(v) of the car.
The Input
The input consists of 3 integers in each line (a,b,c<50) denoting
the initial velocity,acceleration and elapsed time.

The Output
The output will be the final velocity in a seperate line.

Sample Input
123

Sample Output
7

208 - Square Formula:

The Problem
Make a simple program that reads two variables named a, b.
Calculate the formula of (a+b) 2.
The Input
The input file contains 2 integer
numbers a, and b (a<100, b<100).

The Output
Output will show the value of (a+b) 2 in a separate line.

Sample Input
24

Sample Output
36

209 - Professor’s Homework:

The Problem
Nora is learning summation of numbers. So her Professor has
given her homework “Summation of numbers from 1 to N”.
Can you help Nora to complete her homework?

1 + 2 + 3 + … + N = ???

The Input
The input file contains 1 integer number N (N<=200).

The Output
Output will show the sum of series 1 to N numbers in a
separate line.

Sample Input
125

Sample Output
7875

210 - Professor’s Homework (II):

The Problem
Nora has done the previous homework very nicely. So
her Professor has given her homework again. This
time Professor says “You have to find three consecutive
numbers whose summation is N.“

21 + 22 + 23 = 66

The Input
The input file contains one integer number N (N<=300).

The Output
Output will show the three consecutive integer numbers in a
separate line.

Sample Input
297

Sample Output
98 99 100

211 - Consecutive Odd Numbers:

The Problem
Make a simple program that reads one variable
named N which is the summation of 3 consecutive odd
numbers. Print the 3 consecutive odd numbers whose
summation is N.

21 + 23 + 25 = 69
The Input
The input file contains one integer number N (N<=3000).

The Output
Output will show the 3 consecutive odd integer numbers
seperated by space in a separate line.

Sample Input
1617

Sample Output
537 539 541

212 - Consecutive Even Numbers:

The Problem
Make a simple program that reads one variable
named N which is the summation of 4 consecutive even
numbers. Print the 4 consecutive even numbers whose
summation is N.

22 + 24 + 26 + 28 = 100

The Input
The input file contains one integer number N (N<=5000).

The Output
Output will show the 4 consecutive even integer numbers
seperated by space in a separate line.

Sample Input
812

Sample Output
200 202 204 206

213 - Pond Digging:

The Problem
Mrs. Rahman has a rectangle plot. He wants to dig a pond there.
For this he called Ali. Ali said he will charge taka as per
square of the pond. Ali also said 2 miters will be the edge of
the pond. Your work is to help Mrs. Rahman to find the area of
the pond as he can easily pay Ali.

The Input
The input file contains two integer numbers length, L (L<=500)
and width, W (W<=400) of the plot.

The Output
The output will show the area of the pond in a separate line.

Sample Input
80 65

Sample Output
4636

214 - Square Summation:

The Problem
Make a simple program that read one variable named N.
Calculate the summation of the squares of the first N integer
number(12 + 22 + 32 +…+N2).
The Input
The input file contain one integer number N (N<30).

The Output
Output will show the summation of the squares of the first N
integer numbers.

Sample Input
20

Sample Output
2870

215 - Age Calculation:

The Problem
Akash is a student of class VII. He is 20 years younger than his
father,Mr. Rahman but he is 6 years older than his
sister Ritu. Ritu is 6 months older than her sister Mitu.
If Mitu is N years old then what will be her
father, Mr. Rahman’s age.
The Input
Input will contain a single integer number N (N<=20) age
of Mitu.

The Output
The output will contain two integer numbers years and months
separate by a space will show in a separate line.

Sample Input
8

Sample Output
34 Years 6 Months

216 - Motu Patlu Returns:

The Problem
Motu and Patlu has a food shop. This days their shop is
making enough revenue. Motu's share is 2 time greater
than Patlu's share. So while distributing the
money Motu always gets double money than Patlu. So now
as Motu and Patlu are very weak in math they need your help.
So now write a program to find out Motu's amount
and Patlu's amount from the total money.

The Input
The input will be a integer number (a<30,000) denoting the
total money. (The total amount will be a number which is always distributable
according to the above description so You need not think about fractions.)

The Output
For each input you have to show the Motu's money
and Patlu's money which is separated by space in a separate
line.

Sample Input
9372

Sample Output
6248 3124

217 - The national flag of Bangladesh:

The Problem
The national flag of Bangladesh is bottle green in color and
rectangular in size with the length (L) to width(W) ratio of 10:6.
It bears a red circle on the background of green. If the lenght
is L can you find the width (W).
The color in the background represents the greenery of
Bangladesh while the red circle symbolizes the rising sun and
the sacrifice of lives in our freedom fight.

Example:
if L = 10 then W = 6

The Input
The input file contains only one integer numbers L , which is
the length of the flag (L<=1500).

The Output
Output will show the one integer number which is the width(W)
of the flag in a separate line.

Sample Input
10

Sample Output
6

218 - Multi Process:

The Problem
Make a simple program that reads one variables named N. Now
do the process multiply N by 567, then divide the result by 9,
then add 7492, then multiply by 235, then divide by 47, then
subtract 498. Print the final result.

The Input
The input file contains 1 integer numbers N (1<N<40).

The Output
Output will show the process value in a separate line.

Sample Input
11

Sample Output
40427

219 - Monkey Vs Bamboo:

The Problem
There is an H feet long Bamboo which is smeared with oil. A
monkey climb up M feet at first minute & drop down N feet in
the second minute. So now find out how many minutes it will
take to reach the ending point of the bamboo?
The Input
The input file contains three integer number H, M & N (H<1000,
M<1000, N<1000 and M>N).

The Output
Output will show the total minutes take to reach the ending
point of the bamboo.

Sample Input
92 12 8

Sample Output
41

220 – Midpoint:

The Problem

 Any point in 2-D may be located by an ordered pair (x, y).


 The x-coordinate, x, is the value on the x-axis vertically
above or below the point.
 The y-coordinate, y, is the value on the y-axis horizontally
right or left of the point.

Make a simple program that reads 4 variables


named x1, y1 and x2, y2 which are represent two points (x1, y1)
and (x2, y2). You task is to find the midpoint between 2 given
points (x1, y1) and(x2, y2).
The Input
The input file contains 4 integer numbers x1, y1, x2,
and y2 (x1, y1, x2, y2 < 1000).

The Output
Output will show two intiger values seperated by space which
represend the midpoint in a separate line.

Sample Input
480 785 472 233

Sample Output
476 509

221 – Farming:

The Problem
Ramij is a farmer. He wants to plough a farm field on time, so
he must plough M hectares a day. For technical reasons he
ploughed only P hectares a day, hence he had to
plough C more days than he planned and he still
has D hectares left.
Now write a program to calculate the area of the farm field and
how many days Ramij planned to work initially.
The Input
There will be 4 inputs (M, P, C, D<100) in each line according to
above description.

The Output
For each line of output print the area of the farm field and how
many days Ramij will work initially.

Sample Input
120 85 2 40

Sample Output
6 720

You might also like