You are on page 1of 4

Pragmatic Software Test

Exercise 1 (15 points)

Question: Professor is giving lesson to two classes. He has 2 students in one class and three students
in the other class. Read the student information and find the class with the highest average.

Input specification
You will be given five lines of information. In every line, you will have class name, student name,
student surname, and student grade. Where class name is at most 3 characters containing only
English letters or digit from 0 to 9. Name and surname are at most 15 characters containing only
English letters. Student grade is an integer between 1 and 100.

Output specification
Show the class name and average (with 2 digits precision) which has the highest average.

Sample Input I Sample Output I


10A Andi Visari 80 11A 91
10A Evis Ajazi 67
11A Genti Agolli 92
10A Endri Drita 47
11A Erion Shehu 90

Exercise 2 (10 points)

Question: An isosceles triangle is a triangle with (at least) two equal sides. You will be given the
three sides of a triangle, check if it is an equilateral triangle. Note: Assume that the given number
triples comply the triangle property (any one side is smaller than the sum of the other two sides).

Input specification: You will be given 3 integers (s1, s2, s3) where 0 ≤ (s1, s2, s3) ≤ 10 million.

Output specification: Show "Yes", if it complies the isosceles triangle property. Show "No",
otherwise

Sample Input I Sample Input II


575 357

Sample Output I Sample Output II


Yes No

EXERCISE 3 (15 points)

Ladder is a set of cubes in one or more layers in which each over the top layer contains fewer blocks
than the bottom.

Get in touch with us


endfejfnrjnf
Rr. Tish Dahia, Kompleksi Kika 2, Sh. 6, H. 3D, Tiranë Email: info@pragmatic.al
www.pragmatic.al Tel. No: (+355) 4 452 1686
Count the number of ladders that can be built from N cubes.

Enter
At the entrance recorded the number N (1 ≤ N ≤ 100).
Output
Print the required number of ladders.

Input

Output

EXERCISE 4 (30 points)

In Camelot, friendship is reciprocal. The Round Table is located in a huge hall, rounded by N chairs.
Each knight wants to sit near his friends, otherwise he refuses to sit.
Everyone is waiting for the wizard Merlin to solve this problem, but Merlin cannot find the magic
formula. Help Merlin to sit all the knights, so that each sitting knight has friends in his two sides.

Input

In the first line is given an integer number n, where n is the number of the Knights of the Round Table
(3<=n<=100 ). The knights are numbered from 1 to n.
Each of the following n lines contains a sequence of n values 0 or 1, separated by a space. The i-th
sequence shows the friendship relations of the i-th knight. The j-th value determines if the i-th knight
is a friend of the j-th knight. They are friends if the value is 1, and not friends if the value is 0.
Since friendship is reciprocal, if I is a friend of j, j is also friend of i.

Output

If the knights can be sit around the round table, show ‘YES’, otherwise show ‘NO’.

Input I

5
01101
10011
10011

Get in touch with us


endfejfnrjnf
Rr. Tish Dahia, Kompleksi Kika 2, Sh. 6, H. 3D, Tiranë Email: info@pragmatic.al
www.pragmatic.al Tel. No: (+355) 4 452 1686
01101
11110

Output 1
YES

EXERCISE 5 (20 points)

There is a piece of cheese in a rectangle with the size of N x M . Poor little mouse wants to eat the
entire cheese. Starting at an arbitrary cell, he is eating regular slices (1x1) of cheese, and then passes
to the next (Only if it has not eaten). Help small little mouse to draw the route such that he eats all
the cheese.

Input
In the first line the numbers N and M is given. (1 <= N , M <= 30).
Output
Withdraw the route as a sequence of a mouse coordinates pieces, which he eats. Slices of cheese are
the coordinates of 1 to N on the X, from 1 to M on Y axis.

Input

22

Output

1 1
2 1
2 2
1 2

Exercise 6 (10 points)

Mr. Tafaj has gone for a trip abroad. He wants to call his family from a
call center. The rates change according to the minute you talked:

• The first 3 minutes is $6


• Every additional 10 seconds is $0.5

Question:
Write a program that is going to get the total seconds (seconds) talked. And then, it will print the
amount due from the user.

Input specification
You will be given an integer number (seconds) where 0 ≤ seconds ≤ 20000

Get in touch with us


endfejfnrjnf
Rr. Tish Dahia, Kompleksi Kika 2, Sh. 6, H. 3D, Tiranë Email: info@pragmatic.al
www.pragmatic.al Tel. No: (+355) 4 452 1686
Output specification
Calculate and show the amount due from the user.

Sample Input I Sample Input II


190 191

Sample Output I Sample Output II


6.5 7

Get in touch with us


endfejfnrjnf
Rr. Tish Dahia, Kompleksi Kika 2, Sh. 6, H. 3D, Tiranë Email: info@pragmatic.al
www.pragmatic.al Tel. No: (+355) 4 452 1686

You might also like