DMPG '19 B3 - Contact

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

For those who are socially awkward, talking to others is a harrowing task. Did you say too much? Too little?

It is this last one that you have become increasingly worried about. Going through your conversations, you record each message as either sent by you (S), or received by you (R).

You believe that you are spamming if you have sent at least K consecutive messages without receiving any replies in between. Can you write a program to see if you have been bothering your fellow netizens?

Constraints

1 \leq K \leq 2\,000
Additionally, the total number of messages sent will not exceed 2\,000.

Input Specification

The first line of input will contain a single string, composed of either S or R.
The second and final line of input will contain a single integer, K.

Output Specification

Output Spamming if you have sent at least K consecutive messages without receiving any replies in between, and All good otherwise.

Sample Input 1

SSRS
3

Sample Output 1

All good

Sample Input 2

SSSSSRSSS
4

Sample Output 2

Spamming

Comments

There are no comments at the moment.