#127. 3或5的非同时倍数判断

    ID: 127 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatLogic-1gesp1条件结构数学基础

3或5的非同时倍数判断

Multiple of 3 or 5 (Not Both)

Background

Dawei and Xiaoxiao are playing a number game. They want to determine if a given non-negative integer satisfies a special condition.

Problem Description

Given a non-negative integer, return true if it is a multiple of 33 or 55, but not both. Use the % (modulo) operator.

Input Format

Input is given from Standard Input in the following format.

A non-negative integer nn.

Output Format

Output is to Standard Output in the following format.

Output true if the condition is met, otherwise false.

Sample

3
true
10
true
15
false

Sample Explanation

  • For Sample 11, the input is 33. 33 is a multiple of 33 but not 55. The condition (multiple of 33 or 55, but not both) is met, so output true.
  • For Sample 22, the input is 1010. 1010 is not a multiple of 33 but is a multiple of 55. The condition is met, so output true.
  • For Sample 33, the input is 1515. 1515 is a multiple of both 33 and 55. The condition (not both) is not met, so output false.

Constraints

The input integer nn satisfies 0n1090 \le n \le 10^9. Time limit: 11 second, Memory limit: 10241024 KiB for each test case.