Vous êtes sur la page 1sur 2

Contest Length: 2:30

Marks Distribution:
Problem No Marks
15
27
3 10
45
5 4+4+6
6 3+7
7 4+5
8 4+8
9 3+6+6
10 10
11 3+9
12 11
1. Solve for positive integers:
2. Given two numbers a and b, write an algorithm that swaps these two numbers without
introducing any additional variable.
3. Given the sequence (25, 24, , 2, 1), you may swap the position of any two number. What is
the minimum number of swaps needed to sort this sequence in ascending order? Explain.
4. Is it possible to color a triangular grid? Justify your answer.
5. A recursive function f(n) is defined by f(n)=a*f(n-1)+b*f(n-2), where a, b and n are positive
integer. Three consecutive terms if this series are 26, 54, 106. Given f(1)=1. Find
1. a, b
2. f(12)
3. f(1048)
6. Let n=2^9 * 3^4. How many positive integer divisors of n^2 are less than n but do not divide n?
What is the answer if n=2^39 * 3^41?
7. We have a program that gives a random permutation of the word MATHEMATICS. All
permutations are equally probable.
1. What is the probability that the first letter of the permutation is M?
2. In how many permutations M will be the first letter?
8. You have
1. 100 notes of 1 taka,
2. 100 notes of 2 taka,
3. 100 notes of 5 taka,
4. 100 notes of 10 taka and
5. 100 notes of 20 taka.
Now if you want to pay taka 4 there is 3 ways to do so, use 4 notes of taka 1, 2 notes of taka 1
and 1 note of taka 2 or use 2 notes of taka 2.
How many was you can pay
1. Taka 8
2. Taka 20
9. You are given a number N. At every step you can add or subtract 1. In how many ways you can
make M by K moves?

For example, for N=0, K=3 and M=1, you can do it in 3 ways:
0+1+1-1 or 0+1-1+1 or 0-1+1+1.
1. What is the answer for N=0, M=2, K=4?
2. What is the answer for N=116, M=100, K=30?
3. What is the answer for N=121, M=122, K=60?
10. There are two apple trees. In the first apple tree apple falls at: 1, 5, 6, 7, 12, 17, 18, 22, 25
seconds. At second tree: 2, 6, 7, 9, 10, 13, 15, 19, 20 seconds.
You need 3s to move from one tree to another. If you are at the first tree initially what is the
maximum amount of apple he can collect? To collect an apple you have to be at that tree in the
exact time the apple falls.
11. The king of Byteland wants to build roads in his country. Currently there are no roads here. He
wants to build roads between cities such that every city can be reached from every city, possibly
using some intermediate cities. For example if there's a road between city A and city B and city
B and city C, then we'll say city C can be reached from city A. Note that all roads are
bidirectional. Thus if city A is reachable from C, then city C is reachable from A. As King is
short on fund, he wants to minimize the cost of building roads. Byteland has 6 cities named A,
B, C, D, E and F. Consider following table. It shows the cost of building road. The cost of
building road between city C and city F is 10.
A
B
C
D
E
F
A

20

20

11

20

20

12

10

10

13

F
1. How many roads he have to build to ensure all cities are reachable from all other cities.
2. What is the minimum cost of building roads in this way.
12. Find median of following 99 numbers: 164640659.22, 164640659.222222, 54846.028571,
1571273.52, 1571273.521277, 243639791.2, 243639791.25, 238903.9158, 238903.915810,
298806.8961, 298806.89611, 1459318.476, 1459318.476415, 14712576.88, 14712576.875,
25010.68312, 25010.683121, 1011675938, 1011675938, 1856224190, 1856224190,
3036929.95, 3036929.95082, 29898.19708, 29898.197078, 208467093.2, 208467093.2,
12642.69019, 12642.690194, 28728606.54, 28728606.54, 80410919, 80410919.5,
376274826.5, 376274826.5, 1744493.308, 1744493.307692, 446409398.3, 446409398.333333,
143022.3401, 143022.340147, 24449.07818, 24449.078184, 12264148.68, 12264148.683573,
1496113.986, 1496113.985656, 1883570151, 1883570151, 249301468.8, 249301468.75,
4082.08385, 4082.083850, 3292517.654, 3292517.653846, 222894.2968, 222894.296785,
722204.004, 722204.00368, 231560401.4, 231560401.375, 2862012.841, 2862012.841481,
389012.8357, 389012.835736, 17803169.252, 17803169.252252, 6318862.5, 6318862.5,
1152143924, 1152143924, 833.01807, 833.01807, 832876.88, 832876.878788, 10452523.5,
10452523.5, 95179.79662, 95179.796616, 97548998.8, 97548998.833333, 1691.25313,
1691.253133, 75656.3404, 75656.340389, 470253.8450, 470253.845013, 120952675.6,
120952675.6, 43397016.9, 43397016.875, 457971.424, 457971.423767, 14849705.778,
14849705.777778, 25955194.65, 25955194.653846, 229657.68

Vous aimerez peut-être aussi