Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Sentimos muito que algo saiu errado. O que aconteceu?

book
Cake Division

One cozy afternoon, Lily and her friend Noah decided to buy a large cake from their favorite bakery. They chose the most decadent one, layered with rich frosting and fresh berries. After purchasing, the cake was weighed, showing a total weight of n grams. Excited to share it, they hurried home but soon realized they faced a tricky problem.

Lily and Noah are big fans of even numbers, so they want to divide the cake in such a way that each of the two portions weighs an even number of grams. The portions don’t need to be equal, but each must have a positive weight. Since they’re both tired and eager to enjoy the cake, you need to help them determine if it’s possible to split it the way they want.

Given an integer number n - the weight of cake bought by Lily and Noah, return a string YES, if Lily and Noah can divide the cake into two parts, each of them weighing an even number of grams and NO in the opposite case.

Example 1

Input:

120

Output:

YES

Example 2

Input:

155

Output:

NO
main.cpp

main.cpp

cpp

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt