526A.md (2395B)
1 Source: https://codeforces.com/problemset/problem/526/A 2 3 A. King of Thieves 4 5 time limit per test 6 7 1 second 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 standard input 16 17 output 18 19 standard output 20 21 In this problem you will meet the simplified model of game King of Thieves. 22 23 In a new ZeptoLab game called "King of Thieves" your aim is to reach a chest with gold by controlling your character, avoiding traps and obstacles on your way. 24 25  26 27 An interesting feature of the game is that you can design your own levels that will be available to other players. Let's consider the following simple design of a level. 28 29 A dungeon consists of *n* segments located at a same vertical level, each segment is either a platform that character can stand on, or a pit with a trap that makes player lose if he falls into it. All segments have the same length, platforms on the scheme of the level are represented as '*' and pits are represented as '.'. 30 31 One of things that affects speedrun characteristics of the level is a possibility to perform a series of consecutive jumps of the same length. More formally, when the character is on the platform number *i*1, he can make a sequence of jumps through the platforms *i*1 < *i*2 < ... < *i**k*, if *i*2 - *i*1 = *i*3 - *i*2 = ... = *i**k* - *i**k* - 1. Of course, all segments *i*1, *i*2, ... *i**k* should be exactly the platforms, not pits. 32 33 Let's call a level to be good if you can perform a sequence of four jumps of the same length or in the other words there must be a sequence *i*1, *i*2, ..., *i*5, consisting of five platforms so that the intervals between consecutive platforms are of the same length. Given the scheme of the level, check if it is good. 34 35 Input 36 37 The first line contains integer *n* (1 ≤ *n* ≤ 100) — the number of segments on the level. 38 39 Next line contains the scheme of the level represented as a string of *n* characters '*' and '.'. 40 41 Output 42 43 If the level is good, print the word "yes" (without the quotes), otherwise print the word "no" (without the quotes). 44 45 Examples 46 47 Input 48 49 ``` 50 16 51 .**.*..*.***.**. 52 ``` 53 54 Output 55 56 ``` 57 yes 58 ``` 59 60 Input 61 62 ``` 63 11 64 .*.*...*.*. 65 ``` 66 67 Output 68 69 ``` 70 no 71 ``` 72 73 Note 74 75 In the first sample test you may perform a sequence of jumps through platforms 2, 5, 8, 11, 14.