clc
clear all
format long g
h=input('hi');
L=input('L');
n=input('n');
for i=1:n;
bs(i)=input('bs');
fs(i)=input('fs');
dh(i)=bs(i)-fs(i);
h(i+1)=dh(i)+h(i);
end
f=sum(bs)-sum(fs);
e=12*sqrt(L);
if f<=e;
c=-f/n;
for i=1:n
hc(i)=h(i)+i*c
end
end