結果

問題 No.3796 Fanmade Tile Distance
ユーザー masasu
提出日時 2026-11-13 22:46:04
言語 PyPy3
(8.0.1 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 155 ms / 2,000 ms
+ 261µs
コード長 529 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 75 ms
コンパイル使用メモリ 64,128 KB
実行使用メモリ 72,320 KB
最終ジャッジ日時 2026-11-13 22:46:14
合計ジャッジ時間 3,347 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# https://github.com/robe2222555/atcoder-lib/blob/main/template/python/main.py
import sys
input = lambda: sys.stdin.readline().rstrip()
def LI(): return list(map(int, input().split()))
def II(): return int(input())
INF = 1<<60

def solve():
	A,B,sx,sy,tx,ty = LI()
	sx += A*(10**8)
	sy += B*(10**8)
	tx += A*(10**8)
	ty += B*(10**8)
	
	sx -= sx%A
	sy -= sy%B
	tx -= tx%A
	ty -= ty%B

	print(abs(sx-tx)//A + abs(sy-ty)//B)

	return


def main():
	T = II()
	for _ in range(T):
		solve()
	return


if __name__ == '__main__':
	main()
0