[r]
(1)I PHONG CIAO DU C VA DAO T4O NAMTRUC
oE cgirrru rguc
Citr 3: t 5,0 di,;int ) T6ng rr'6'c
Cho s5 ttr nhi6n N" I( (l< Ar<10,,1<1(<9) DOm s6
DE firr HQC SINr{ crOI CAp mryEN NAM HQC20L7 - 2018 M6n: TIN HQC - Lop: I
Thoi gian ldm bdi: 150 phrit DC thi g6m: 02 trang
elffL ( a,0 diAn) Tinh ing T\n biti: tong.pas Cho s6 tu nhi6n N ( I < t/ < 106 ) Tinh t6ng sau
^S = 2 + 4 + 6 + + 2l\r
Dir li6u: vio tir t0p vdn ban ToNG.INP bao g6m s6 ttr nhiOn N duy nh6t
K6t quri: Ghi tcp viin bin ToNG.our Ghi kOt cprA cira t6ng trOn
Vi dr.r:
TONG.II{P TONG.OUT
1
Ciiu : (5,0 di€nt) SO Dep TAn bcii: soclep.pas
M6t sa) netty6n clttong c1u'cl-c goi li s5 etep n6u t6ng c6c chri so cLra no h0 thip ph1n chia hOt cho sd chu's6 cr-ra n6 Cfc s6 du'crc xet kh6ng chira chf,'s6 c6 nghia (0123) Y6u ciu: IJiiy cho Uiet s5 N ccl "Eep" hay kh6ng?
Dfr'li6u: vio tir t0p v[n bin SoDEp.INp ch[ra rn6t so N11< ]/ < 10r8 )
Dir li6u: Ghi tOp viin ban SoDEl,.ouT chfra xdu ki tr.r S thu6c {.,Co,,;,,Khong,,} tr)y
theo N la s6 "Dep" htry khdng
Vi tlu:
SODEP.INP SODEP.OUT
/.J ) Khong
t7 Co
T€n bdi: tonguoc.pas cac rLdc cua N chia h6t cho K vDr tinh t6ng cic uryc cl6
Dir li6u: Vr)o tiL tOp vin ban TONGUOC.INP cluy nh6t rndt clong chira hai s6 N, K KOt qrrri : Ghi la tOp vin ban c6 TOI\GUOC.OUT g6m:
Dong li s5 c6c udc cua N chia h6t cho.I( Ddng 2 t6ng c6c tr6'c c1ti
V[ tlu :
TONGUOC.il\TP TONGUOC.OUT
15
(2)Cflu 4: ft,O cliA@ h{ua hirng TAn bdi: mlt.pas Co n ngtrdi xOp thr\nh hiing theo thri'tr.r c16 mua hing 'l'hdi gian ngtrdi b6n hang phuc vt1 cho ngrrd'i thir i ld t; clon vi thdi gian Hly tirn thdi gian mir ngudi thir k phAi cho c16 mua
hing
Dir liQu: Vio tir tOp r,[n ban MH.I|{P:
- Dong 1: chira hai s5 n, k ngn,vOu cltro-ng (1<k<n< 100);
- Ddng 2: cir[ta,, s5 t,, t2, tn.(Cfc gi5 tr:i t; c16u nguy0n cluong vi nho hon
I 000)
I(6t quri: Dua t6p vln bin MIf.OUT chira cluy nh6t s6 C thoa mdn y6u cAu cira clir liQu
rrio
Vi tlu:
MH.INP MH.OUT
53
t3211
4
B:ii 5: (2,0 di€m) TUI DU'ONG T€rt bdi: tuiduong.pas
An li nhAn viOn giao hing cy nhr\ mii1, cltrdng NhiQm vu cua An lAn ld phii giao dfng
n kg dLrdng cho rl6t xi nghi0p bfinh keo O nhi rn6y, cludng clucrc dong g6i tlong 2loqi
t[ri: tiri clu'ng cltroc kg r,i t[ri kg, s6 ltro-ng clrrd'ng tlong m6i tiri phai dugc d6ng dirng r,6'i s[rc chila cria no kh6ng thira vzi 1th6ng thi6Lr
Vi clu: D0 giao 18 l<g clirtrng An co th0 mang tiri lo1i kg ho[c 3 tiri loai kg vd tiri lo1i lig An 1r.r6n 1u6n ,.,'r.,6,r chon phr-rong 6n cho sO tiri cAn mang li it nhAt
1'0u ciu: Cho re f t < rV < I0'') IIiy xfc clinh s5 tiri it nh6t cAn -a,rg N6u kh6ng co c6ch rrans thi clr-ra la s6 -
D{i'li\u: Vrio tir t6p viin ban TUIDUOIi{G.INP g6m mQt clong chira s5 nguy6n r. r
[At tlutt: DrLa rl tOp vln ban'f UIDUOI{G.OUT mQt s6 nguy6n - kOt qr-ri xic dinh drroc VI drt:
I-I A+
-l tL L - -_
TUIDUONG.INP TUIDUONG.OUT
1B
t