Company: Winzo_30july
Difficulty: medium
Hard task for Alice Problem Description Bob gives Alice a task to do. The task was to build a string S of length N. Starting with an empty string, C, she can perform two operations: Add a character at the end of C for A rupees Copy any substring of C, and then add it to end of C for B rupees Alice was happy to perform this task. Then, Bob challenged Alice to tell the minimum amount of money needed to build S. The input consists of two lines: The first line contains 3 space separated integers N, A and B respectively. The second line contains string S which Bob wishes to build. The output should be the minimum cost to build S. Examples Example 1: Input: 9 8 9 bacbacab Output: 42 Constraints 1 <= N <= 10 4 1 <= A, B <= 10000