PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GD0000160. Xây dựng chuỗi ký tự (Construct the String)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Xây dựng chuỗi ký tự (Construct the String)
Construct the String
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , construct a lowercase English string of length in which every contiguous substring of length exactly contains exactly distinct letters. A solution is guaranteed to exist.
Input
One line contains three integers in this order.
Output
Print a string of exactly lowercase English letters satisfying the condition for every length- window.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
7 5 3
Output
abcabca
Explanation
The string abcabca has length . Its three length- substrings are abcab, bcabc, and cabca, each containing exactly the letters a, b, and c.