#31013: WA (line:101)


tana760828 (tana)


題目並沒有限制k的大小,所以有可能出現k>n的情況。

解法:if(k>n)k=n;

範測:

input
8 9 1 3 -1 -3 5 3 6 7

output
-3 7