HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Fyodor Menshikov. Training > problem:


01B. 50600 - Expression

Guest
• Discussion of problem (1)

Volume problems

• 01A. 50650 - Prime numbers
• 01E. 50661 - nth Power of a Digit
• 02B. 50625 - Permutations
• 02C. 50626 - The route
• 02F. 50647 - Spiral
• 03A. 50633 - The prime factors
• 03B. 50720 - Permutations (2)
• 03F. 50616 - Snake
• 01B. 50600 - Expression
• 01C. 50601 - Increasing sequence
• 01D. 50660 - Triangle and the point
• 02A. 50662 - Prime numbers (2)
• 02E. 50607 - Long sum
• 03D. 50666 - The card and envelope
• 03E. 50606 - Long product
• 04A. 50634 - Perfect numbers
• 04B. 50635 - Decomposition into terms

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