KLEF, Hyderabad
SEE- Skill Examinations, May ( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-1
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. New Year Resolution
To start the year 2026 off, Chef made a resolution to exercise daily. He decided to do exactly X
push-ups every day.
If he sticks to his resolution, how many push-ups will he do in the month of January?
Note that the month of January has 31 days.
Input Format
● The first and only line of input will contain a single integer X , denoting the number of
push-ups Chef does every day.
Output Format
Output a single integer: the number of push-ups Chef will do in January.
Sample Input: Sample Output:
5 155
Q2. Front-Back Matching
You are given a string S of length N .
The string contains only lowercase English letters.
You can freely rearrange the characters of S however you like.
After rearrangement, is it possible to make the first and last characters of S equal?
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● Each test case consists of two lines of input.
o The first line of each test case contains a single integer N — the length of string S
.
o The second line contains the string S of length N .
Output Format
For each test case, output on a new line the answer: either Yes or No, depending on whether it's
possible to rearrange the string appropriately or not.
Each character of the output may be printed in either uppercase or lowercase, for example the
strings yes ,YES , yES will all be accepted if valid rearrangements exist.
Sample Input: Sample Output:
4 Yes
3 No
aka No
4 Yes
nope
5
pluto
5
foggy
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-2
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Winter is Coming
Chef feels comfortable depending on the temperature and whether or not he is wearing a jacket.
● Chef feels comfortable without a jacket if and only if the temperature is greater than or
equal to A .
● Chef feels comfortable with a jacket if and only if the temperature is less than or equal
to B.
● It is guaranteed that A ≤ B .
● Chef is not wearing a jacket initially.
You are given the temperature T i for the next N days.
Chef can choose to wear or remove his jacket any number of times, but each time he puts on the
jacket is counted as one action.
Find the minimum number of times Chef needs to wear a jacket so that he feels comfortable
on all N days.
Input Format
● The first line contains a single integer T , denoting the number of test cases.
● For each test case:
● The first line contains three space-separated integers N , A , and B.
● The second line contains N space-separated integers T 1 , T 2 , … , T N , where T i is the
temperature on the i-th day.
Output Format
For each test case, output a single integer — the minimum number of times Chef needs to wear a
jacket.
Sample Input: Sample Output:
2 2
5 20 30 1
15 25 35 28 10
4 10 15
12 9 15 16
Q2. Odd String
You are given a string S of length N consisting only of lowercase English letters.
A string is called an odd string if and only if:
● For every pair of indices i< j such that Si=S j, the distance between them is odd, i.e. ( i ) is
odd.
● In other words, no two equal characters are allowed to appear at an even distance from
each other.
You are allowed to rearrange the characters of the string S in any order.
Determine whether it is possible to rearrange S such that it becomes an odd string.
Sample Input: Sample Output:
8 YES
1 YES
a NO
2 YES
bb NO
5 YES
xxxxx YES
7 YES
aabccbd
8
aabccbdc
8
abcdabcd
8
codechef
5
abcde
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-3
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Popcorn Buying
Chef has gone to see a movie. Chef has X ( X ≥ 100) rupees with him.
The movie ticket itself costs 100, and Chef must buy one movie ticket to be able to see the
movie.
With the money leftover, Chef will buy as many popcorn buckets as possible. A single popcorn
bucket costs 50 rupees. How many popcorn buckets will Chef be able to buy?
Input Format
● The first and only line of input contains a single integer X .
Output Format
Output the number of popcorn buckets Chef can buy after paying for the movie ticket.
Sample Input: Sample Output:
145 0
Q2. Candy Types
The candies in this universe come in N colours, numbered 1 to N .
You have N candies with you, the i -th candy having a colour Ai .
You wonder what is the most frequent colour among your candies. In case there is a tie, you
should print the smaller colour among all the most frequent colours.
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● Each test case consists of multiple lines of input.
o The first line contains a single integer N .
o The second line contains N integers - A1 , A 2 ,… , A N .
Output Format
For each test case, output on a new line the most frequent colour of your candies.
Sample Input: Sample Output:
3 1
3 3
123 3
3
333
5
33441
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-4
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Candy Types
The candies in this universe come in N colours, numbered 1 to N .
You have N candies with you, the i -th candy having a colour Ai .
You wonder what is the most frequent colour among your candies. In case there is a tie, you
should print the smaller colour among all the most frequent colours.
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● Each test case consists of multiple lines of input.
o The first line contains a single integer N .
o The second line contains N integers - A1 , A 2 ,… , A N .
Output Format
For each test case, output on a new line the most frequent colour of your candies.
Sample Input: Sample Output:
3 1
3 3
123 3
3
333
5
33441
Q2. Layered Cake
Chef is making a layered cake consisting of 2 layers.
Chef has N options for the first layer, represented by an array A=[ A1 , A 2 , … , A N ], where Ai
represents the size of the i -th first layer of the cake.
Similarly, Chef has M options for the second layer, represented by an array B=[B1 , B2 , … , B M ],
where Bi represents the size of the i -th second layer of the cake.
Chef must ensure that the size of the second layer is strictly smaller than
the size of the first layer. How many possible cakes can make by combining Sample Sample
one first layer and one second layer, while respecting that constraint? Input: Output:
Input Format 4 2
● The first line of input will contain a single integer T , denoting the 4 2 9
number of test cases. 5261 1
● Each test case consists of multiple lines of input. 3 7 0
33
o The first line contains 2 integers - N and M . 333
o The second line contains N integers - A1 , A 2 ,… , A N . 222
o The third line contains N integers - B1 , B2 , … , B M . 11
5
Output Format
2
11
1
1
For each test case, output on a new line the number of valid layered cakes Chef can make.
.
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May ( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-5
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Qualified or Not
TanMinati and Bhavy participated in the first round of a coding competition organized by the
Coding Club, IIT Ropar during Advitiya.
To qualify for the next round, a participant must defeat both TanMinati and Bhavy.
A participant can defeat another participant by solving at least twice the number of problems as
that participant.
Given that TanMinati solved X problems and Bhavy solved Y problems, determine whether a
participant who solved N problems can participate in the next round.
Input Format
● The first and only line of input will contain three integers N , X , and Y , denoting the
number of problems solved by the participant, TanMinati, and Bhavy respectively.
Output Format
Output YES if the participant qualifies. Otherwise, output NO.
You may print each character of the string in either uppercase or lowercase (for example, the
strings yEs, yes, Yes and YES will all be treated as identical).
Sample Input: Sample Output:
422 YES
531 NO
Q2. The Coding Streak
TanMinati loves solving problems.
You are given an array A of size N , where Ai represents the number of problems TanMinati
solved on the i -th day.
A "streak" is defined as a sequence of consecutive days where TanMinati solves at least 1
problem every day.
Find the length of the longest streak present among these N days.
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● Each test case consists of two lines of input.
o The first line of each test case contains a single integer N — the size of the array.
o The next line contains N space-separated integers A1 , … , A N , where Ai denotes
the number of problems solved by TanMinati on i-th day.
Output Format
For each test case, output on a new line the length of the longest streak by TanMinati.
Sample Input: Sample Output:
4 1
1 1
1 2
2 0
50
4
0520
2
00
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-6
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Payment Scheme
Chef picked out several items in a shop, and now has to pay for them.
The shop offers Chef two payment schemes:
1. Pay 100 coins immediately, and then pay X coins every week for the next four weeks.
2. Pay 300 coins immediately, with no future payments required.
Find the minimum possible number of coins Chef needs to pay if he chooses the payment
scheme appropriately.
Input Format
● The input contains a single integer X — the required weekly payment for the first
payment scheme.
Output Format
Output a single integer: the minimum possible number of coins Chef needs to pay.
Sample Input: Sample Output:
8 132
Sample Input: Sample Output:
77 300
Q2. All Even
There are N numbers written on a blackboard.
These N values are denoted A1 , A 2 ,… , A N from left to right.
You can modify the blackboard using the following three-step procedure, as long as N ≥ 2:
● First, add A N to A N−1.
● Then, erase A N from the blackboard.
● Finally, reduce N by 1.
In simpler words, you can add the last value to the second-last value; then erase the last value
from the blackboard.
You like even numbers, so you would like to know: is it possible to repeatedly perform this
three-step procedure several times (possibly, zero times), so that eventually there are only even
numbers written on the blackboard?
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● Each test case consists of two lines of input.
o The first line of each test case contains a single integer N — the initial number of
values on the blackboard.
o The second line contains N space-separated integers A1 , A 2 ,… , A N — the values
on the blackboard.
Output Format Sample Sample
For each test case, output on a new line the answer: either YES or NO , depending on Input: Output
whether it's possible to make every value on the blackboard even or not. 4 :
Each character of the output may be printed in either uppercase or lowercase, i.e. the 3 Yes
strings NO , no , nO , and No will all be treated as equivalent. 211 Yes
3 No
123 Yes
4
1312
5
22141
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May ( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-7
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Rush to Exam
Chef has an exam in the next N hours, and he still has to read M pages of a book to be fully
prepared for the exam.
Every hour, Chef reads is able to read exactly A pages. Will Chef be able to read all M pages
before the exam? Print Yes or No accordingly.
Input Format
● The first and only line contains 3 integers - N , M and A .
Output Format
Print Yes if Chef will be able to finish reading all M pages, and No otherwise.
Sample Input: Sample Output:
362 YES
Sample Input: Sample Output:
372 No
Q2. IceCream Cones
Chef has forgotten his ice cream cone in the sun, and it is melting.
Currently, there is X grams of ice cream in his cone, and every minute that the cone is left out, Y
grams of ice cream melt and are lost.
If Chef comes back after N minutes, how much ice cream is still left for him?
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● The first and only line of each test case contains 3 integers - X , Y and N .
Output Format
For each test case, output on a new line the amount of ice cream left after N minutes.
Sample Input: Sample Output:
3 3
512 0
517 5
50 5 9
*****ALL THE BEST*****
KLEF, Hyderabad
SEE- Skill Examinations, May( 2025-2026 )
[Link] (CSE)
Year & Sem: II Year II Semester Name of the Subject: DAA
Subject Code: 24CS2203 Sem: Even
Set-8
[Link]. Component Marks
1. Write-Up(program, algorithm) 2 x 12 = 24 M
Execution 2 x 8 = 16 M
2.
Viva 10M
Total 50M
Q1. Fonta
A drink is called fanta-like if the last three letters of its name are ❑' n' ,❑' t ' , and ❑' a ', in that
order.
That is, the name of the drink must end with nta.
You bought a drink from a vending machine.
The name of the drink is represented by the string S.
It is guaranteed that S consists of exactly 5 lowercase English letters.
Is the drink fanta-like?
Input Format
● The first and only line of input contains a single string S of length 5, denoting the name
of the drink you bought.
Output Format
Print the answer: YES if the drink is fanta-like, and NO otherwise.
Each character of the output may be printed in either uppercase or lowercase, i.e. the
strings NO , nO , No, and no will all be treated as equivalent.
Sample Input: Sample Output:
fonta YES
Sample Input: Sample Output:
pasta No
Q2. Bank Glitch
In Chefland, there are 2 currencies in use, currency 1 and currency 2. Normally, one unit of
currency 1 is worth exactly 1 unit of currency 2.
Chef currently has A units of currency 1, and B units of currency 2.
However, he has found a glitch in the banking system, which allows him to trade X units of
currency 1 for Y units of currency 2, where X <Y , so this is a positive trade for him to make
Chef may make this trade multiple times, however it has to be exactly X units for Y units and not
just smaller parts in the same ratio - for example, if X =3 and Y =6 it is not allowed to
exchange 2 units of currency 1 for 4 units of currency 2.
What is the maximum amount of money Chef can end up with? The amount of money being
measured as the sum of currency 1 and 2.
Input Format
● The first line of input will contain a single integer T , denoting the number of test cases.
● The first and only line contains 4 integers - A , B, X and Y .
Output Format
For each test case, output on a new line the maximum amount of money Chef can end up with.
Sample Input: Sample Output:
3 13
5 2 4 10 7
5 2 6 10 12
4412
*****ALL THE BEST*****