| 1 |
n, k, s = map(int, input().split()) if s < k or k * (n - 1) < s: print("NO") exit() print("YES") cur_pos = 1 while s > k: delta = min(n - 1, s - (k - 1)) s -= delta cur_pos += delta if cur_pos + delta <= n else -delta k -= 1 print(cur_pos, end=" ") while k > 0: cur_pos += 1 if cur_pos + 1 <= n else -1 k -= 1 print(cur_pos, end=" ") print() n=int(input()) m=int(input()) count=0 c=[] for i in range(n): a = int(input()) c.append(a) c.sort() for i in range(len(c)-1): s=c[i]+c[i+1] if c[i]==m: coumt=0 break if s<m: count+=1 print(count+1) |
Комментарии