結果

問題 No.2797 Square Tile
ユーザー shotoyooshotoyoo
提出日時 2024-06-28 22:35:20
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,243 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,364 KB
実行使用メモリ 79,552 KB
最終ジャッジ日時 2024-06-28 22:35:23
合計ジャッジ時間 3,202 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, random
input = lambda : sys.stdin.readline().rstrip()


write = lambda x: sys.stdout.write(x+"\n"); writef = lambda x: print("{:.12f}".format(x))
debug = lambda x: sys.stderr.write(x+"\n")
YES="Yes"; NO="No"; pans = lambda v: print(YES if v else NO); INF=10**18
LI = lambda v=0: list(map(lambda i: int(i)-v, input().split())); II=lambda : int(input()); SI=lambda : [ord(c)-ord("a") for c in input()]
def debug(_l_):
    for s in _l_.split():
        print(f"{s}={eval(s)}", end=" ")
    print()
def dlist(*l, fill=0):
    if len(l)==1:
        return [fill]*l[0]
    ll = l[1:]
    return [dlist(*ll, fill=fill) for _ in range(l[0])]

a,b = list(map(int, input().split()))
VV = a*a + b*b
f = 0
if a>b:
    a,b = b,a
    f = 1
assert a<=b
if a==b:
    xy = [(i,j) for i in range(0, a*a*2, a) for j in range(0, a*a*2, a)]
    for x,y in xy:
        print(x%VV,y%VV)
else:
    xy0 = []
    xy1 = []
    x = y = 0
    for i in range(a*a + b*b):
        xy0.append((x,y))
        x += b
        y += a
    x = b
    y = 0
    for i in range(a*a+b*b):
        xy1.append((x,y))
        x += b
        y += a
    if not f:
        xy0,xy1 = xy1,xy0
    for x,y in xy0:
        print(x%VV,y%VV)
    for x,y in xy1:
        print(x%VV,y%VV)
0