Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|
Problem hidden on 2011-12-18 07:47:52 by VOJ Team

DD8HUONG - 8 direction

ĐƯỜNG ĐI 8 HƯỚNG

Một điểm đang ở tọa độ (0,0). Có n bước đi. Mỗi bước đi có dạng [hướng đi,độ dài]. Trong đó hướng đi là bắc, đông bắc, đông, đông nam, nam, tây nam, tây, tây bắc ứng với các số 1..8. VD: [1,2] là đi lên 2 đơn vị.

Yêu cầu: Tìm tọa độ điểm sau n bước đi. Chương trình chỉ 200B.

Input: dòng đầu tiên ghi chữ n (n<=109). n dòng tiếp theo, mỗi dòng ghi 1 bước đi.

Output: tọa độ x,y cách nhau 1 dấu cách, làm tròn 2 chữ số thập phân.

INPUT  OUTPUT 

 8

1 9

2 7

3 8

7 8

2 7

1 9

3 4

4 5

17.44  24.36

8 direction

 

One point is at coordinates (0.0). There are n steps. Every step of the form [direction, length]. In which direction is north, northeast, east, southeast, south, southwest, west, northwest, with the number 1 .. 8. Example: [1.2] is going up 2 units.

 

Requirements: Find coordinates of the n steps. The program is only 200B.

 

Input: the first line the word n (n <= 109). The next n lines, each line recorded a walk.

 

Output: x, y separated by a space, rounded two decimal places.


Được gửi lên bởi:Nguyen Thanh Dat
Ngày:2011-12-14
Thời gian chạy:0.100s
Giới hạn mã nguồn:200B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ASM64 GOSU PERL6 PYPY RUST SED
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.