Nộp bài | Các bài nộp | Làm tốt nhất | Về danh sách bài |
NUMPAIRS - Cặp số |
Given three positive integers ( m ), ( n ), and ( k ), count the number of integer pairs ((x, y)) that satisfy the following conditions:
( 0 \leq x \leq m ), ( 0 \leq y \leq n ), and ( x + y ) is divisible by ( k ).
Input:
- A single line containing three positive integers ( m ), ( n ), and ( k ), where ( k \leq 10^9 ), separated by spaces.
Output:
- Print the number of pairs that satisfy the given conditions.
Example:
Input:
6 8 3
Output:
21
Được gửi lên bởi: | noname00.pas |
Ngày: | 2017-11-29 |
Thời gian chạy: | 0.100s |
Giới hạn mã nguồn: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Ngôn ngữ cho phép: | C-CLANG C CSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG C99 JAVA PAS-FPC PYTHON PYTHON3 |
Nguồn bài: | Bài tập Ôn HN 01/2017 (Thầy Lê Minh Hoàng) |