Logo
(追記) (追記ここまで)

13149번 - Knapsack in a Globalized World 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB130635448.214%

문제

Globalization stops at nothing, not even at the good old honest profession of a burglar. Nowadays it is not enough to break in somewhere, take everything you can carry and dart off. No! You have to be competitive, optimize your profit and utilize synergies.

So, the new game rules are:

  • break only into huge stores, so there is practically endless supply of any kind of items;
  • your knapsack should be huge;
  • your knapsack should be full (there should be no empty space left).

Damn you, globalization, these rules are not easy to follow! Luckily, you can write a program, which will help you decide whether you should loot a store or not.

입력

The input consists of:

  • one line with two integers n (1 ≤ n ≤ 20) and k (1 ≤ k ≤ 1018), where n is the number of different item types and k is the size of your knapsack;
  • one line with n integers g1, . . . , gn (1 ≤ gi ≤ 103 for all 1 ≤ i ≤ n), where g1, . . . , gn are the sizes of the n item types.

출력

Output “possible” if it is possible to fill your knapsack with items from the store (you may assume that there are enough items of any type), otherwise output “impossible”.

제한

예제 입력 1

2 10000000000
3 6

예제 출력 1

impossible

예제 입력 2

2 10000000000
4 6

예제 출력 2

possible

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > German Collegiate Programming Contest > GCPC 2016 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /