Descriprion:Ceramic artists Maria and João are opening a small $\texttt{azulejo}$ store in Porto. $\texttt{Azulejos}$ are the beautiful ceramic tiles for which Portugal is famous. Maria and João wa...

Description:Professor Octastichs has invented a new pro-gramming language, Smeech. An expression in Smeech may be a positive or negative integer, or may be of the form (p e 1 e 2 ) where p is a rea...

Description:Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat movement from a cat video. To do this, he extracts cat features in each frame. A cat featur...

Description:Mur loves hash algorithm, and he sometimes encrypt another one's name, and call him with that encrypted value. For instance, he calls Kimura KMR, and calls Suzuki YJSNPI. One day he rea...

Description:The Power Cube is used as a stash of Exotic Power. There are n cities numbered 1,2,…,n where allowed to trade it. The trading price of the Power Cube in the i-th city is ai dollars per ...

Description:You can perfectly predict the price of a certain stock for the next N days. You would like to profit on this knowledge, but only want to transact one share of stock per day. That is, ea...

Description:Lawson is a magic swordsman with k kinds of magic attributes $v_1,v_2,v_3,…,v_k.$ Now Lawson is faced with n monsters and the i-th monster also has k kinds of defensive attributes $a_{i...

Description:The mode of an integer sequence is the value that appears most often. Chiaki has n integers $a_1,a_2,...,a_n$. She woud like to delete exactly m of them such that: the rest integers hav...

Description:You are given $n$ segments on a coordinate line; each endpoint of every segment has integer coordinates. Some segments can degenerate to points. Segments can intersect with each other, ...

Description:The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . ...

Description:Xiangqi is one of the most popular two-player board games in China. The game represents a battle between two armies with the goal of capturing the enemy’s “general” piece. In this probl...

Description:White Rabbit wants to know the maximum number of cars that can be put into to ensure that there is a way that allows all cars to perform their entire journey without damage. (update: al...

Description:Far far away, there live a lot of dogs in the forest. Unlike other dogs, those dogs love candies much more than bones.Every candy has two attributes: the sweetness degree p and the sour...

Description:DreamGrid has n classmates numbered from 1 to n. Some of them are boys and the others are girls. Each classmate has some gems, and more specifically, the i-th classmate has i gems.Dream...

Description:Array of integers is unimodal, if:it is strictly increasing in the beginning;after that it is constant;after that it is strictly decreasing.The first block (increasing) and the last blo...

Description:You are given positive integer number n. You should create such strictly increasing sequence of k positive numbers $a_{1} , a_{2}, ..., a_{k}$ , that their sum is equal to n and greates...

Description:There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves...

Description:Doki Doki Literature Club! is a visual novel developed by Team Salvato. The protagonist is invited by his childhood friend, Sayori, to join their high school's literature club. The prot...

Description:BaoBao has just found a positive integer sequence $a_{1},a_{2},……,a_{n}$ of length n from his left pocket and another positive integer b from his right pocket. As number 7 is BaoBao's f...