PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SCKTIFELSE0000002. Xác định năm nhuận (Leap Year Determination)
Bài tập này chưa được xếp vào lộ trình.
Mục lục đề ⌄
Đang đọc
Xác định năm nhuận (Leap Year Determination)
Leap Year Determination
Version: Phuoc Hung OJ Extended
Problem Statement
In the Gregorian calendar, a year is a leap year if it is divisible by , or if it is divisible by but not by . Every other year is a common year. Given a positive calendar year , determine whether it is a leap year.
Input
A single line containing the positive integer , the calendar year.
Output
Print NAM_NHUAN if is a leap year; otherwise print NAM_THUONG.
Subtasks
-
Subtask 1 (20 points):
-
Subtask 2 (30 points):
-
Subtask 3 (50 points):
Examples
Example 1
Input
1900
Output
NAM_THUONG
Explanation
The year is divisible by but not by , so it is a common year.
Example 2
Input
2000
Output
NAM_NHUAN
Explanation
The year is divisible by , so it is a leap year.
Example 3
Input
2024
Output
NAM_NHUAN
Explanation
The year is divisible by but not by , so it is a leap year.