program lai_suat_tiet_kiem;
var
n, k, m, t: real;
begin
write('Nhap lai suat tiet kiem (t%/thang): ');
readln(t);
t := t / 100;
write('1. Tinh tong so tien (von + lai) sau k thang: ');
write('Nhap so von ban dau: ');
readln(n);
write('Nhap so thang can goi: ');
readln(k);
writeln('Tong so tien (von + lai) sau ', k:0:0, ' thang: ', n * power(1 + t, k):0:2);
write('2. Tinh so thang can goi de nhan duoc so tien m: ');
write('Nhap so tien can nhan: ');
readln(m);
write('Nhap so von ban dau: ');
readln(n);
k := log10(m / n) / log10(1 + t);
writeln('So thang can goi: ', k:0:0);
write('3. Tinh so von ban dau can goi: ');
write('Nhap so tien can nhan: ');
readln(m);
write('Nhap so thang can goi: ');
readln(k);
n := m / power(1 + t, k);
writeln('So von ban dau can goi: ', n:0:2);
readln;
end.