Lisa’s Workbook

Cerinta completa Lisa just got a new math workbook. A workbook contains exercise problems, grouped into chapters. Lisa believes a problem to be special if its index (within a chapter) is the same as the page number where it’s located.

Kingdom Division

Cerinta completa King Arthur has a large kingdom that can be represented as a tree, where nodes correspond to cities and edges correspond to the roads between cities. The kingdom has a total of cities numbered from to . The

Letter Islands

Cerinta completa You are given string and number . Consider a substring of string . For each position of string mark it if there is an occurence of the substring that covers the position. More formally, position will be marked

Interval Selection

Cerinta completa Given a set of intervals, find the size of its largest possible subset of intervals such that no three intervals in the subset share a common point. Input Format The first line contains an integer, , denoting the

Larry’s Array

Cerinta completa Larry has been given a permutation of a sequence of natural numbers incrementing from as an array. He must determine whether the array can be sorted using the following operation any number of times: Choose any consecutive indices

K Factorization

Cerinta completa At the time when Pythagoreanism was prevalent, people were also focused on different ways to factorize a number. In one class, Pythagoras asked his disciples to solve one such problem, Reverse Factorization. They were given a set of

Ice Cream Parlor

Cerinta completa Two friends like to pool their money and go to the ice cream parlor. They always choose two distinct flavors and they spend all of their money. Given a list of prices for the flavors of ice cream,