from tkinter import*
class Rec(Frame):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
k=int(input('Введите количество линий : '))
step = 300//k;
self.master.title("1")
self.pack(fill=BOTH, expand=1)
canvas = Canvas(self, bg="white")
for i in range (0, k+1):
canvas.create_line(0, i*step, 300, 300-i*step)
canvas.pack(fill=BOTH, expand=1)
def main():
root = Tk()
ex = Rec()
root.geometry("300x300")
root.mainloop()
if __name__ == '__main__':
main()
massiv = list(map(int,input().split()))
k = int(input('Введите k'))
с = int(input('Введите с'))
massiv.insert(k,c)
massiv = massiv[:k]+[c]+massiv[k:]
massiv.append(massiv[-1])
for i in massiv[-1:k-1:-1]:
massiv[i] = massiv[i-1]
massiv[k]=c