Submission #646619

# Submission time Handle Problem Language Result Execution time Memory
646619 2022-09-30T10:32:42 Z ovidiush11 Gardening (RMI21_gardening) C++17
0 / 100
121 ms 892 KB
#include <bits/stdc++.h>
using namespace std;

#define ll long long

void solve()
{
    ll n,m,k;
    cin>>n>>m>>k;
    if(k > floor(n/2) * floor(m/2))
    {
        cout<<"NO"<<endl;
        return ;
    }
    cout<<"YES"<<endl;
    ll x = 1,y = 1,s = 0;
    for(ll i = 0;i < n;i++)
    {
        for(ll j = 0;j < m;j+=2)
        {
            cout<<y<<" "<<y<<" ";
            if(y != k)y++;
        }
        if(m % 2 == 1)cout<<y;
        cout<<endl;
        if(s == 0)
        {
            s++;
            y = x;
        }
        else
        {
            s = 0;
            if(y == k)y = x;
            else x = y;
        }
    }
    return ;
}

int main()
{
    ll t;
    cin>>t;
    while(t--)solve();
    return 0;
}
# Verdict Execution time Memory Grader output
1 Failed 121 ms 892 KB Output does not contain all values between 1 and k
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 121 ms 892 KB Output does not contain all values between 1 and k
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 121 ms 892 KB Output does not contain all values between 1 and k
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 16 ms 656 KB Output contains flowers without two equal neighbours
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 9 ms 380 KB Output does not contain all values between 1 and k
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Failed 121 ms 892 KB Output does not contain all values between 1 and k
2 Halted 0 ms 0 KB -