RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00095

Trezor

Diamond V 다이아몬드 V
난이도
3s
시간 제한
32MB
메모리 제한
1
맞았습니다!!
1
제출 수
100.0%
정답률
레이팅

의견: 0

설명

Mirko decided to open a new business – bank vaults. A branch of the bank can be visualized in a plane, vaults being points in the plane. Mirko's branch contains exactly \(L \cdot (A + 1 + B)\) vaults, so that each point with integer coordinates inside the rectangle with corners \((1, -A)\) and \((L, B)\) contains one vault.

The vaults are watched by two guards – one at \((0, -A)\), the other at \((0, B)\). A guard can see a vault if there are no other vaults on the line segment connecting them.

A vault is not secure if neither guard can see it, secure if only one guard can see it and super-secure if both guards can see it.

Given \(A\), \(B\) and \(L\), output the number of insecure, secure and super-secure vaults.

제약

In test cases worth 50% of points, L will be at most 1000.
In test worth another 25% of points, A and B will be at most 100 (but L can be as large as one billion).

입력 형식

The first line contains integers \(A\) and \(B\) separated by a space (\(1 \le A \le 2000\), \(1 \le B \le 2000\)).

The second line contains the integer \(L\) (\(1 \le L \le 1\,000\,000\,000\)).

출력 형식

Output on three separate lines the numbers of insecure, secure and super-secure vaults.

Scoring: In test cases worth \(50\%\) of points, \(L\) will be at most \(1000\). In tests worth another \(25\%\) of points, \(A\) and \(B\) will be at most \(100\) (but \(L\) can be as large as one billion).

서브태스크
서브태스크점수설명

Subtask 1

60점

\(L \le 1000\)

Subtask 2

30점

\(A \le 100\), \(B \le 100\) (\(L\) up to \(10^9\))

Subtask 3

30점

No additional constraints.

예제 1
입력
1 1
3
출력
2
2
5
예제 2
입력
2 3
4
출력
0
16
8
예제 3
입력
7 11
1000000
출력
6723409
2301730
9974861
문제 정보

riseoj 작성

출처 COCI 2008/2009 Contest 4

평가 및 의견

Trezor

개요
출제자 난이도 Diamond V 다이아몬드 V 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Trezor

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8