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

16327번 - Broken Watch 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB104524759.494%

문제

A UFO crash lands on Earth. The alien captain survives the crash relatively unscathed; however his trusty watch is damaged beyond repair.

The alien watch is very similar to a human watch: It is a disc 30mm in diameter and it has three hands of lengths A, B and C microns (1000 ≤ A, B, C ≤ 15000). However, the aliens measure time differently: there are N (2 ≤ N < 2 32) alien seconds to an alien minute. As such, there are N markings on the edge of the disc, rather than 60.

The watch’s glass cover is broken and the hands have come loose: they can rotate freely and independently of one another. By pointing each of the hands at an arbitrary marking, their tips can be made to form an imaginary triangle (as long as they are non-collinear).

Having nothing left to do but wait for help to arrive, the alien ponders the following question: What is the number M of distinct triangles that contain the watch’s center? (Triangles where the center lies on one of the edges of the triangle count as well.)

입력

The input consists of A, B, C, and N on a single line, separated by whitespace.

출력

The output is M modulo 264.

제한

예제 입력 1

15000 15000 15000 2

예제 출력 1

0

예제 입력 2

5000 10000 15000 3

예제 출력 2

6

예제 입력 3

15000 15000 15000 3

예제 출력 3

1

예제 입력 4

15000 15000 15000 4

예제 출력 4

4

예제 입력 5

15000 15000 15000 5

예제 출력 5

5

예제 입력 6

15000 15000 15000 6

예제 출력 6

14

힌트

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2018 B번

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

출처

대학교 대회

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

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