BaoBao is trapped in a one-dimensional maze consisting of grids arranged in a row! The grids are numbered from 1 to from left to right, and the -th grid is marked with a character , where is either 'L' or 'R'. Starting from the -th grid, BaoBao wi…
The 2017 China Collegiate Programming Contest Qinhuangdao Site is coming! There will be teams participating in the contest, and the contest will be held on a huge round table with seats numbered from 1 to in clockwise order around it. The -th team…
PUBG is a multiplayer online battle royale video game. In the game, up to one hundred players parachute onto an island and scavenge for weapons and equipment to kill others while avoiding getting killed themselves. BaoBao is a big fan of the game, bu…
BaoBao has just found a string of length consisting of 'C' and 'P' in his pocket. As a big fan of the China Collegiate Programming Contest, BaoBao thinks a substring of is "good", if and only if 'C', and 'P', where denotes the -th charact…
Given an array of integers , we say a set is a prime set of the given array, if and is prime. BaoBao has just found an array of integers in his pocket. He would like to select at most prime set of that array to maximize the size of the union o…
DreamGrid has a nonnegative integer . He would like to divide into nonnegative integers and minimizes their bitwise or (i.e. and should be as small as possible). Input There are multiple test cases. The first line of input contains an integer , i…