z.leaf = y.leaf
z.n = t - 1
for j = 1..to t - 1:
z.key[j] = y.key[j+t]
if not y.leaf
for j = 1..to t:
z.c[j] = y.c[j+t]
y.n = t - 1
for j = x.n + 1..to i + 1:
x.c[j+1] = x.c[j]
x.c[i+1] = z
for j = x.n..to i:
x.key[j+1] = x.key[j]
x.key[i] = y.key[t]