HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


01B. 50600 - Expression

Guest
• Discussion of problem (1)

Volume problems

• 01A. 50650 - Prime numbers
• 01B. 50600 - Expression
• 01C. 50601 - Increasing sequence
• 01D. 50660 - Triangle and the point
• 01E. 50661 - nth Power of a Digit
• 01F. 50620 - Poker
• 02A. 50662 - Prime numbers (2)
• 02B. 50625 - Permutations
• 02C. 50626 - The route
• 02D. 50667 - Intersecting Line Seg...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 3000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Фёдор Меньшиков, ВГПУ. Difficulty Beta

Given N integers, X1, X2, X3... XN, evaluate an expression by putting '+' or '-' signs, which is equal to a sum S.

Input
The first line contains the integers N ( N ≤ 24) and S (-1000000000 ≤ S ≤ 1 billion) . The second line contains N, integers Xi ( 0 ≤ Xi ≤ 50 million).

Output
Print out the solution, or in its absence output "No Solution".
Test 1 Test 2
3 10
15 25 30
2 100
10 10
Вывод 1 Вывод 2
15 + 25 - 30 = 10
No solution

Для отправки решений необходимо выполнить вход.

www.contester.ru