🌟

B3

2024/06/29に公開

ここ

import argparse


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

def getIntList():
    return list(map(int, input().split()))

def main():
    N,A = getIntMap()
    l = getIntList()

    r = []

    p = l[0] + A
    r.append(p)

    for i in range(1,N):
        if p < l[i]:
            p += l[i] - p
        p +=A
        r.append(p)

    print(' '.join(map(str,r)))

if __name__ == '__main__':
    main()

Discussion