Created
March 9, 2022 23:40
-
-
Save zesterer/d936f25d7d64fffd4e13ad0f545baada to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int bar(unsigned int x) { | |
for (int i = x - 1; i >= 2; i--) | |
for (int s = x; s >= 0; s -= i) | |
if (s == 0) | |
return 0; | |
return 1; | |
} | |
int foo(unsigned int x) { | |
if (x <= 2 || (x & 1) != 0) | |
return 1; | |
for (int i = x; i > 0; i--) | |
if (bar(i) && bar(x - i)) | |
return i + 1; | |
return 0; | |
} | |
int main() { | |
int a; | |
int x; | |
scanf("%X", &x); | |
if (foo(x) != 0) | |
a = 0; | |
return a; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment