Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Задача E
- program Morgana;
- var a:string;
- input,output: text;
- i,j,K,K1,K2:integer;
- S,P: real;
- m:array [1..10000]of real;
- BEGIN;
- Assign(input,'input.txt');
- Assign(output, 'output.txt');
- Reset(input);
- Readln(input,K,S);
- ReWrite(output);
- P:=K*S;
- K1:=K;
- FOR i:=1 TO K DO Read(input,m[i]);
- Close(input);
- FOR i:=1 TO K DO
- Begin;
- If K1=0 then break;
- K2:=K1;
- K1:=K;
- FOR j:=1 TO K DO
- if m[j]<S then K1:=K1-1;
- if K1<>0 then S:=P/K1;
- End;
- If K1>0 then
- Begin;
- Writeln(output,'YES');
- Write(output,S);
- END
- else
- Begin;
- Writeln(output,'NO');
- Write(output,P/K2);
- End;
- Close(output)
- END.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement