跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F0553. Problem B: Alaska

    ID: 559 传统题 1000ms 128MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>待分类整理状态难度待定难度共享题库高校与竞赛共享题英文题面题目来源题面语言

Problem B: Alaska

题目描述

Problem B: Alaska

The Alaska Highway runs 1422 miles from Dawson Creek, British Columbia to Delta Junction, Alaska. Brenda would like to be the first person to drive her new electric car the length of the highway. Her car can travel up to 200 miles once charged at a special charging station. There is a charging station in Dawson Creek, where she begins her journey, and also several charging stations along the way. Can Brenda drive her car from Dawson City to Delta Juntion and back?

输入格式

The input contains several scenario. Each scenario begins with a line containing n, a positive number indicating the number of charging stations. n lines follow, each giving the location of a filling station on the highway, including the one in Dawson City. The location is an integer between 0 and 1422, inclusive, indicating the distance in miles from Dawson Creek. No two filling stations are at the same location. A line containing 0 follows the last scenario.

输出格式

For each scenario, output a line containing POSSIBLE if Brenda can make the trip. Otherwise, output a line containing the word IMPOSSIBLE.

样例 1

输入

2
0
900
8
1400
1200
1000
800
600
400
200
0
0

输出

IMPOSSIBLE
POSSIBLE

题目来源:Waterloo ACM Programming Contest September 26, 2010;FPS 共享题包,题包内第 2 题。保留原作者与原赛事署名。