АВТ
Language:

Remote Training on Programming

Problems On-line status Contests FAQ
For authors:
Register  ||  Login
 
Hello, Guest! Login or register.

71. Two Stones - 1

Time Limit: 1 seconds
Memory Limit:64000KB
Points:10
View Problem Statistics Submit Problem added Administrator

Имеется куча камней разных весов. Найдутся ли в ней два камня, дающие в сумме заданный вес?

В первой строке входного файла содержится N (1 <= N <= 10 000) — число камней, во второй строке — разделённые пробелами N целых чисел (от 1 до 10 000) — веса камней, в третьей — целое число (от 1 до 20 000), вес, который нужно набрать.

В выходной файл вывести одно слово "YES", если вес набрать можно, или "NO" в противном случае.

Примеры

STDIN

STDOUT

3

1 3 3

2

NO

3

1 3 3

6

YES

 


View Problem Statistics Submit Author/source:
Problems from Contests / Vologda Students Contests / VIII InterUni Contest 2005 /
71. 72. Two Stones - 2 73. A - Join Words 74. B - Circle and Points
Problems from Contests / Trainings of Vologda STU / Training 26.11.2008 /
82. C-Joke 71. 72. Two Stones - 2
We can all benefit by doing occasional "toy" programs, when artificial restrictions are set up, so that we are forced to push our abilities to the limit. The art of tackling miniproblems with all our energy will sharpen our talents for the real problems. Donald E. Knuth.
time generating 0.094 sec.
© Copyright VSTU, AVT, Nosov D.A.