⌨️

[AtCoder]ABC-250|A - Adjacent Squares

2023/06/22に公開

設問ページ

提出結果

def getIntMap():
    return map(int, input().split())


def main():
    h, w = getIntMap()
    r, c = getIntMap()

    s = 0
    s += 1 if 1 < r <= h else 0
    s += 1 if 1 <= r < h else 0
    s += 1 if 1 < c <= w else 0
    s += 1 if 1 <= c < w else 0

    print(s)


if __name__ == "__main__":
    main()

Discussion