JMU F18 Week 13


2018-11-30 19:30 UTC

JMU F18 Week 13


2018-12-06 21:00 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -261 days 23:08:40

Time elapsed


Time remaining


Problem C
The Weight Of Words

Justin likes to play a game called “Weight of Words.” In this game, a player must find words of a given length and a given weight. The weight of a word is the sum of the weights of its letters. Letters are English lowercase characters from ‘a’ to ‘z’ and have weights from $1 \ldots 26$.

You are asked to write an AI that can play this game!


The input consists of a single line with two integers $l$ ($0 < l \le 40$) and $w$ ($0 < w \le 1000$).


Output a string of length $l$ with weight $w$ consisting of lowercase English letters if it exists, otherwise output impossible. If more than one string exists, you may output any of them.

Sample Input 1 Sample Output 1
11 131
Sample Input 2 Sample Output 2
7 96
Sample Input 3 Sample Output 3
26 677