uses crt;
var phan,thanh,tuan,tong,sck:longint;
begin
clrscr;
tuan:=30000;
thanh:=tuan*2;
phan:=thanh-10000;
tong:=tuan+thanh+phan;
sck:=(tuan+thanh+phan) div 7;
writeln('So cay kem mua duoc la: ',sck);
writeln('So tien con du la: ',tong-sck);
readln;
end.