oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

luckynumbers Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

luckynumbers.html

Problem Description

A number is considered lucky if it can be represented as a sum of a non-negative number of 4s and a non-negative number of 7s. For example, 18 is lucky because 18 = 7 + 7 + 4. Given T numbers in an array A, tell me whether each of them is lucky.

Input

The first line of input will contain one integer, T.

The second line of input will contain T integers, representing the array A.

Output

The output should contain T lines with T strings, either "Lucky" or "Unlucky", with the i-th line representing the luckiness of the i-th number.

Limits

For all subtasks: 1 ≤ T ≤ 105.

Subtask 1 (12%): 1 ≤ T, Ai ≤ 100.

Subtask 2 (37%): 1 ≤ Ai ≤ 106.

Subtask 3 (20%): 1 ≤ Ai ≤ 109.

Subtask 4 (31%): 1 ≤ Ai ≤ 1018.

Subtask 5 (0%): Sample Testcases.

Sample Input 1

4
1 4 11 17

Sample Output 1

Unlucky
Lucky
Lucky
Unlucky

Tags

Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
11221s256MBMinimum
237121s256MBMinimum
320221s256MBMinimum
431321s256MBMinimum
5011s256MBMinimum

Judge Compile Command

g++-8 ans.cpp -o luckynumbers -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.