This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
int main()
{
int i,j,n,m;
scanf("%d%d",&n,&m);
if(n&1)
{
if(m&1)
{
}
}
else
{
for(i=n;i;i--)printf("%d 1 1\n%d 1 0\n",i,i);
for(i=1;i<=n;i++)
{
if(i&1)for(j=m;j;j--)
{
if(j&1)printf("%d %d 0\n%d %d 1\n",i,j,i,j);
else printf("%d %d 1\n%d %d 0\n",i,j,i,j);
}
else for(j=2;j<=m;j++)printf("%d %d 0\n%d %d 1\n",i,j,i,j);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |