QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#373755#5564. Lots of Landkevinyang#AC ✓1ms3864kbC++209.4kb2024-04-02 04:08:332024-04-02 04:08:34

Judging History

你现在查看的是最新测评结果

  • [2024-04-02 04:08:34]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3864kb
  • [2024-04-02 04:08:33]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

/* Macros {{{ */
/*  A lot of this is from some of Benq's submissions
    [https://codeforces.com/profile/Benq]
    Ugly af to the eyes, but with vim fold its barable
    Hopefully c++20 concepts can make all this stuff must cleaner */

/* Basics {{{ */
using ll = long long;
using ld = long double;
using str = string;

using pi = pair<int, int>;
using pll = pair<ll, ll>;
using pld = pair<ld, ld>;
#define mp make_pair
#define fi first
#define se second

#define arr array
#define ve vector
using vi = vector<int>;
using vll = vector<ll>;
using vld = vector<ld>;

using vpi = vector<pi>;
using vpll = vector<pll>;
using vpld = vector<pld>;

using vvi = vector<vi>;
using vvll = vector<vll>;
using vvld = vector<vld>;

using vvpi = vector<vpi>;
using vvpll = vector<vpll>;
using vvpld = vector<vpld>;

#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz size()
#define rsz(a) resize(a)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()

#define For(i, a, b) for (int i = a; i < b; ++i)
#define Rof(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define rep(a) For(_, 0, a)
#define each(a, x) for (auto &a : x)
#define reach(a, x) for (auto a = x.rbegin(); a != x.rend(); ++a)

template <typename T, typename U>
inline void cmin(T &x, U y) {
    if (y < x) x = y;
}
template <typename T, typename U>
inline void cmax(T &x, U y) {
    if (x < y) x = y;
}
/*}}}*/

/* IO {{{ */

/* Template Macros {{{ */
#define tcT template <class T
#define tcTU tcT, class U
#define tcTUU tcT, class... U
/*}}}*/

inline namespace Helpers { /*{{{*/
tcT, class = void > struct is_iterable : false_type {};
tcT > struct is_iterable<
          T, void_t<decltype(begin(declval<T>())), decltype(end(declval<T>()))>>
    : true_type {};
tcT > constexpr bool is_iterable_v = is_iterable<T>::value;

tcT, class = void > struct is_readable : false_type {};
tcT > struct is_readable<T, typename std::enable_if_t<is_same_v<
                                decltype(cin >> declval<T &>()), istream &>>>
    : true_type {};
tcT > constexpr bool is_readable_v = is_readable<T>::value;

tcT, class = void > struct is_printable : false_type {};
tcT > struct is_printable<T, typename std::enable_if_t<is_same_v<
                                 decltype(cout << declval<T>()), ostream &>>>
    : true_type {};
tcT > constexpr bool is_printable_v = is_printable<T>::value;
} /* namespace Helpers */
/*}}}*/

inline namespace Input { /*{{{*/
tcT > constexpr bool needs_input_v = !is_readable_v<T> && is_iterable_v<T>;
tcTUU > void re(T &t, U &...u);
tcTU > void re(pair<T, U> &p); /* pairs */

/* re: read{{{ */
tcT > typename enable_if<is_readable_v<T>, void>::type re(T &x) {
    cin >> x;
} /* default */
tcT > typename enable_if<needs_input_v<T>, void>::type re(
          T &i);                                   // vectors, arrays, etc...
tcTU > void re(pair<T, U> &p) { re(p.fi, p.se); }  // pairs
tcT > typename enable_if<needs_input_v<T>, void>::type re(T &i) {
    each(x, i) re(x);
}
tcTUU > void re(T &t, U &...u) {
    re(t);
    re(u...);
} /* read multiple}}} */

/* rv: resize and read vectors{{{ */
void rv(size_t) {}
tcTUU > void rv(size_t N, ve<T> &t, U &...u);
template <class... U>
void rv(size_t, size_t N2, U &...u);
tcTUU > void rv(size_t N, ve<T> &t, U &...u) {
    t.rsz(N);
    re(t);
    rv(N, u...);
}
template <class... U>
void rv(size_t, size_t N2, U &...u) {
    rv(N2, u...);
} /*}}}*/

/* dumb shortcuts to read in ints{{{ */
void decrement() {} /* subtract one from each */
tcTUU > void decrement(T &t, U &...u) {
    --t;
    decrement(u...);
}
#define ints(...)    \
    int __VA_ARGS__; \
    re(__VA_ARGS__);
#define int1(...)      \
    ints(__VA_ARGS__); \
    decrement(__VA_ARGS__); /*}}}*/
} /* namespace Input */
/*}}}*/

inline namespace ToString { /*{{{*/
tcT > constexpr bool needs_output_v = !is_printable_v<T> && is_iterable_v<T>;

/* ts: string representation to print */
tcT > typename enable_if<is_printable_v<T>, str>::type ts(T v) {
    stringstream ss;
    ss << fixed << setprecision(15) << v;
    return ss.str();
} /* default */
tcT > str bit_vec(T t) { /* bit vector to string */
    str res = "{";
    For(i, 0, t.sz) res += ts(t[i]);
    res += "}";
    return res;
}
str ts(ve<bool> v) { return bit_vec(v); }
template <size_t SZ>
str ts(bitset<SZ> b) {
    return bit_vec(b);
} /* bit vector */
tcTU > str ts(pair<T, U> p); /* pairs */
tcT > typename enable_if<needs_output_v<T>, str>::type ts(
          T v); /* vectors, arrays */
tcTU > str ts(pair<T, U> p) { return "(" + ts(p.fi) + ", " + ts(p.se) + ")"; }
tcT > typename enable_if<is_iterable_v<T>, str>::type ts_sep(T v, str sep) {
    /* convert container to string w/ separator sep */
    bool fst = 1;
    str res = "";
    for (const auto &x : v) {
        if (!fst) res += sep;
        fst = 0;
        res += ts(x);
    }
    return res;
}
tcT > typename enable_if<needs_output_v<T>, str>::type ts(T v) {
    return "{" + ts_sep(v, ", ") + "}";
}

/* for nested DS */
template <int, class T>
typename enable_if<!needs_output_v<T>, ve<str>>::type ts_lev(const T &v) {
    return {ts(v)};
}
template <int lev, class T>
typename enable_if<needs_output_v<T>, ve<str>>::type ts_lev(const T &v) {
    if (lev == 0 || !v.sz) return {ts(v)};
    ve<str> res;
    for (const auto &t : v) {
        if (res.sz) res.back() += ",";
        ve<str> tmp = ts_lev<lev - 1>(t);
        res.insert(end(res), all(tmp));
    }
    For(i, 0, res.sz) {
        str bef = " ";
        if (i == 0) bef = "{";
        res[i] = bef + res[i];
    }
    res.back() += "}";
    return res;
}
} /* namespace ToString */
/*}}}*/

inline namespace Output { /*{{{*/
template <class T>
void pr_sep(ostream &os, str, const T &t) {
    os << ts(t);
}
template <class T, class... U>
void pr_sep(ostream &os, str sep, const T &t, const U &...u) {
    pr_sep(os, sep, t);
    os << sep;
    pr_sep(os, sep, u...);
}
/* print w/ no spaces */
template <class... T>
void pr(const T &...t) {
    pr_sep(cout, "", t...);
}
/* print w/ spaces, end with newline */
void ps() { cout << "\n"; }
template <class... T>
void ps(const T &...t) {
    pr_sep(cout, " ", t...);
    ps();
}
/* debug to cerr */
template <class... T>
void dbg_out(const T &...t) {
    pr_sep(cerr, " | ", t...);
    cerr << endl;
}
void loc_info(int line, str names) {
    cerr << "Line(" << line << ") -> [" << names << "]: ";
}
template <int lev, class T>
void dbgl_out(const T &t) {
    cerr << "\n\n" << ts_sep(ts_lev<lev>(t), "\n") << "\n" << endl;
}
} /* namespace Output */
/*}}}}}}}}}*/


ve<ve<char>> res;

void print_res() {

    for(int i=0; i<res.sz; ++i) {
        for(int j=0; j<res[i].sz; ++j) {
            cout << (res[i][j] ? res[i][j] : ' ');
        }
        ps();
    }
    ps();
}

int gcd(int a, int b) {
    return (b == 0) ? a : gcd(b, a%b);
}

void pop_res(int r, int c, int n) {
    // ps(r, c, n);
    if(n == 0) return;

    int v = r*c/n;

    if(n >= r) {
        for(int i=0; i<r; ++i) {
            for(int j=c-v; j<c; ++j) {
                res[i][j] = ('A' + (n-1));
            }
            --n;
        }

        // print_res();
        pop_res(r, c-v, n);
        return;
    }

    if(n >= c) {
        for(int j=0; j<c; ++j) {
            for(int i=r-v; i<r; ++i) {
                res[i][j] = ('A' + (n-1));
            }
            --n;
        }

        // print_res();
        pop_res(r-v, c, n);
        return;
    }


    if(r%n == 0) {
        int h = r/n;
        for(int i=0; i<r; i+=h) {
            for(int oi=i; oi<i+h; ++oi) {
                for(int j=0; j<c; ++j) {
                    res[oi][j] = ('A' + (n-1));
                }
            }
            --n;
        }
        // print_res();
        return;
    }

    if(c%n == 0) {
        int h = c/n;
        for(int j=0; j<c; j+=h) {
            for(int oj=j; oj<j+h; ++oj) {
                for(int i=0; i<r; ++i) {
                    res[i][oj] = ('A' + (n-1));
                }
            }
            --n;
        }
        // print_res();
        return;
    }


    // now we know that
    //      n | r*c
    //      n < r and n < c
    //      n does not divide r
    //      n does not divide c
    //      r*c/n | r*c
    //      e.g. (8, 9, 6) -> 72/6 = 4*3 = 12


    // (r*c/n) / (r/gcd(r, n)) | c
    //  h = r/(gcd(r, n))


    int h = r/gcd(n, r), dj = v/h;
    for(int j=0; j<c; j+=dj) {
        for(int oj=j; oj<j+dj; ++oj) {
            for(int i=r-h; i<r; ++i) {
                res[i][oj] = ('A' + (n-1));
            }
        }
        --n;
    }

    // print_res();
    pop_res(r-h, c, n);
}

int r, c, n;
void solve() {
    re(r, c, n);

    if(r*c%n) { ps("impossible"); return; }

    res.assign(r, ve<char>(c));

    pop_res(r, c, n);

    print_res();
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    /* cout << fixed << setprecision(6); */
    int t = 1;
    // cin >> t;
    for (int i = 0; i < t; i++) solve();

    return 0;
    // you should actually read the stuff at the bottom
}

/* stuff you should look for
 * int overflow, array bounds
 * special cases (n=1?)
 * do smth instead of nothing and stay organized
 * WRITE STUFF DOWN
 * DON'T GET STUCK ON ONE APPROACH
 */

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3504kb

input:

4 4 4

output:

DDDD
CCCC
BBBB
AAAA


result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

6 15 9

output:

CCCCCIIIIIIIIII
CCCCCHHHHHHHHHH
BBBBBGGGGGGGGGG
BBBBBFFFFFFFFFF
AAAAAEEEEEEEEEE
AAAAADDDDDDDDDD


result:

ok correct

Test #3:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

100 100 26

output:

impossible

result:

ok correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

1 1 1

output:

A


result:

ok correct

Test #5:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

1 100 25

output:

AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHHIIIIJJJJKKKKLLLLMMMMNNNNOOOOPPPPQQQQRRRRSSSSTTTTUUUUVVVVWWWWXXXXYYYY


result:

ok correct

Test #6:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

100 1 20

output:

A
A
A
A
A
B
B
B
B
B
C
C
C
C
C
D
D
D
D
D
E
E
E
E
E
F
F
F
F
F
G
G
G
G
G
H
H
H
H
H
I
I
I
I
I
J
J
J
J
J
K
K
K
K
K
L
L
L
L
L
M
M
M
M
M
N
N
N
N
N
O
O
O
O
O
P
P
P
P
P
Q
Q
Q
Q
Q
R
R
R
R
R
S
S
S
S
S
T
T
T
T
T


result:

ok correct

Test #7:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

99 98 1

output:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAA...

result:

ok correct

Test #8:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

100 100 25

output:

YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY...

result:

ok correct

Test #9:

score: 0
Accepted
time: 1ms
memory: 3576kb

input:

100 91 26

output:

MMMMMMMLLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
MMMMMMMLLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
MMMMMMMLLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
MMMMMMMLLLLLLLKKKKKKKJJJ...

result:

ok correct

Test #10:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

96 96 24

output:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXX...

result:

ok correct

Test #11:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

12 60 16

output:

DDDDDDDDDDDDDDDPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
DDDDDDDDDDDDDDDOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
DDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
CCCCCCCCCCCCCCCMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
CCCCCCCCCCCCCCCLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL...

result:

ok correct

Test #12:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

77 8 22

output:

DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
DDCCBBAA
FFFFEEEE
FFFFEEEE
FFFFEEEE
FFFFEEEE
FFFFEEEE
FFFFEEEE
FFFFEEEE
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NMLKJIHG
NML...

result:

ok correct

Test #13:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

24 50 20

output:

JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBBAAAAA
JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBBAAAAA
JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBBAAAAA
JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBBAAAAA
JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBBAAAAA
JJJJJIIIIIHHHHHGGGGGFFFFFEEEEEDDDDDCCCCCBBBBB...

result:

ok correct

Test #14:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

60 7 14

output:

GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
GFEDCBA
NMLKJIH
NMLKJIH
NMLKJIH
NMLKJIH
NMLKJIH
NMLKJIH
NMLKJIH
NMLK...

result:

ok correct

Test #15:

score: 0
Accepted
time: 0ms
memory: 3484kb

input:

14 63 18

output:

BBBBBBBAAAAAAARRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
BBBBBBBAAAAAAAQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
BBBBBBBAAAAAAAPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
BBBBBBBAAAAAAAOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
BBBBBBBAAAAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNN...

result:

ok correct

Test #16:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

10 56 20

output:

JJJJJJJJJJJJJJJJJJJJJJJJJJJJTTTTTTTTTTTTTTTTTTTTTTTTTTTT
IIIIIIIIIIIIIIIIIIIIIIIIIIIISSSSSSSSSSSSSSSSSSSSSSSSSSSS
HHHHHHHHHHHHHHHHHHHHHHHHHHHHRRRRRRRRRRRRRRRRRRRRRRRRRRRR
GGGGGGGGGGGGGGGGGGGGGGGGGGGGQQQQQQQQQQQQQQQQQQQQQQQQQQQQ
FFFFFFFFFFFFFFFFFFFFFFFFFFFFPPPPPPPPPPPPPPPPPPPPPPPPPPPP
EEEEEEEEEEEEEEE...

result:

ok correct

Test #17:

score: 0
Accepted
time: 1ms
memory: 3864kb

input:

76 100 8

output:

DDDDDDDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAA
DDDDDDDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAA
DDDDDDDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAA...

result:

ok correct

Test #18:

score: 0
Accepted
time: 1ms
memory: 3840kb

input:

88 6 24

output:

FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
FEDCBA
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG
LKJIHG...

result:

ok correct

Test #19:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

42 24 18

output:

LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
LLKKJJIIHHGGFFEEDDCCBBAA
...

result:

ok correct

Test #20:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

8 87 6

output:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCBBBBBBB...

result:

ok correct

Test #21:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

62 18 1

output:

AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAA...

result:

ok correct

Test #22:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

52 9 2

output:

BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
BBBBBBBBB
AAAAAAAAA
AAAAAAAAA
AAAAAAAAA
AAAAAAAAA
...

result:

ok correct

Test #23:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

57 62 3

output:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...

result:

ok correct

Test #24:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

53 4 4

output:

DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA
DCBA


result:

ok correct

Test #25:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

28 95 5

output:

EEEEEEEEEEEEEEEEEEEDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAA
EEEEEEEEEEEEEEEEEEEDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAA
EEEEEEEEEEEEEEEEEEEDDDDDDDDDDDDDDDDDDDCCCCCCCCCCCCCCCCCCCBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAA
EEEEEEEEEEEE...

result:

ok correct

Test #26:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

12 76 6

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE...

result:

ok correct

Test #27:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

91 83 7

output:

GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG...

result:

ok correct

Test #28:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

78 16 8

output:

HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDCCBBAA
HHGGFFEEDDC...

result:

ok correct

Test #29:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

27 90 9

output:

IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
HHHHHHHHHHHHHHHHHHHHHHHHHHH...

result:

ok correct

Test #30:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

30 23 10

output:

JJJJJJJJJJJJJJJJJJJJJJJ
JJJJJJJJJJJJJJJJJJJJJJJ
JJJJJJJJJJJJJJJJJJJJJJJ
IIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIIIIIIIII
HHHHHHHHHHHHHHHHHHHHHHH
HHHHHHHHHHHHHHHHHHHHHHH
HHHHHHHHHHHHHHHHHHHHHHH
GGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGG
GGGGGGGGGGGGGGGGGGGGGGG
FFFFFFFFFFFF...

result:

ok correct

Test #31:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

6 14 11

output:

impossible

result:

ok correct

Test #32:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

85 99 24

output:

impossible

result:

ok correct

Test #33:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

64 74 18

output:

impossible

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

98 78 16

output:

impossible

result:

ok correct

Test #35:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

11 33 24

output:

impossible

result:

ok correct

Test #36:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

47 5 8

output:

impossible

result:

ok correct

Test #37:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

75 6 23

output:

impossible

result:

ok correct

Test #38:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

15 69 11

output:

impossible

result:

ok correct

Test #39:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

7 74 4

output:

impossible

result:

ok correct

Test #40:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

58 30 11

output:

impossible

result:

ok correct

Test #41:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

48 94 6

output:

FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFF...

result:

ok correct

Test #42:

score: 0
Accepted
time: 0ms
memory: 3520kb

input:

45 92 23

output:

WWWWVVVVUUUUTTTTSSSSRRRRQQQQPPPPOOOONNNNMMMMLLLLKKKKJJJJIIIIHHHHGGGGFFFFEEEEDDDDCCCCBBBBAAAA
WWWWVVVVUUUUTTTTSSSSRRRRQQQQPPPPOOOONNNNMMMMLLLLKKKKJJJJIIIIHHHHGGGGFFFFEEEEDDDDCCCCBBBBAAAA
WWWWVVVVUUUUTTTTSSSSRRRRQQQQPPPPOOOONNNNMMMMLLLLKKKKJJJJIIIIHHHHGGGGFFFFEEEEDDDDCCCCBBBBAAAA
WWWWVVVVUUUUTTTTSSSSR...

result:

ok correct

Test #43:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

96 51 17

output:

QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA
QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA
QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA
QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA
QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEEDDDCCCBBBAAA
QQQPPPOOONNNMMMLLLKKKJJJIIIHHHGGGFFFEEED...

result:

ok correct

Test #44:

score: 0
Accepted
time: 1ms
memory: 3860kb

input:

90 84 24

output:

LLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
LLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
LLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFFFFFFEEEEEEEDDDDDDDCCCCCCCBBBBBBBAAAAAAA
LLLLLLLKKKKKKKJJJJJJJIIIIIIIHHHHHHHGGGGGGGFFF...

result:

ok correct

Test #45:

score: 0
Accepted
time: 1ms
memory: 3568kb

input:

96 51 24

output:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW...

result:

ok correct

Test #46:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

16 99 22

output:

CCCCCCCCCBBBBBBBBBAAAAAAAAAVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
CCCCCCCCCBBBBBBBBBAAAAAAAAAUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
CCCCCCCCCBBBBBBBBBAAAAAAAAATTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
...

result:

ok correct

Test #47:

score: 0
Accepted
time: 1ms
memory: 3564kb

input:

96 91 24

output:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXX...

result:

ok correct