PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#SCKTIFELSE0000002. Xác định năm nhuận (Leap Year Determination)

    ID: 1491 Loại: Thông thường 2000ms 256MiB Tried: 4 Đã chấp nhận: 1 Độ khó: 2 Đăng bởi: Nhãn>FundamentalsInteger arithmeticBasic mathematicsImplementation techniques

Bài tập này chưa được xếp vào lộ trình.

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 400400, or if it is divisible by 44 but not by 100100. Every other year is a common year. Given a positive calendar year yy, determine whether it is a leap year.

Input

A single line containing the positive integer yy, the calendar year.

Output

Print NAM_NHUAN if yy is a leap year; otherwise print NAM_THUONG.

Subtasks

  • Subtask 1 (20 points): 1≤y≤991\le y\le 99

  • Subtask 2 (30 points): 1≤y≤19991\le y\le 1999

  • Subtask 3 (50 points): 1≤y≤99991\le y\le 9999

Examples

Example 1

Input

1900

Output

NAM_THUONG

Explanation

The year 19001900 is divisible by 100100 but not by 400400, so it is a common year.

Example 2

Input

2000

Output

NAM_NHUAN

Explanation

The year 20002000 is divisible by 400400, so it is a leap year.

Example 3

Input

2024

Output

NAM_NHUAN

Explanation

The year 20242024 is divisible by 44 but not by 100100, so it is a leap year.