Statistics

Problem Statement for "SilverbachConjecture"

Problem Statement

In this problem, some test cases have more than one correct output. We are using a special checker to verify that the output of your program is correct.

A positive integer x is called composite if there are positive integers y > 1 and z > 1 such that x = yz. In other words, a composite positive integer has a positive integer divisor other than 1 and itself. For example, 48 is composite because 48 = 4*12. The smallest few composite integers are 4, 6, 8, 9, and 10.

You are given an int n. Return a int[] with two elements. Both elements of the returned int[] must be positive composite integers, and their sum must be n.

For the given constraints on n at least one such pair always exists. Note that if there are many such pairs, your solution can return any one of them.

Definition

Class:
SilverbachConjecture
Method:
solve
Parameters:
int
Returns:
int[]
Method signature:
int[] solve(int n)
(be sure your method is public)

Constraints

  • n will be between 20 and 2000, inclusive.

Examples

  1. 20

    Returns: {8, 12 }

    For n=20 there are seven correct answers: {4,16}, {6,14}, {8,12}, {10,10}, {12,8}, {14,6}, and {16,4}. Your program must return one of these seven answers.

  2. 30

    Returns: {15, 15 }

    You may return two identical numbers.

  3. 999

    Returns: {699, 300 }

  4. 2000

    Returns: {4, 1996 }

  5. 25

    Returns: {9, 16 }

  6. 20

    Returns: {8, 12 }

  7. 21

    Returns: {9, 12 }

  8. 22

    Returns: {4, 18 }

  9. 25

    Returns: {9, 16 }

  10. 35

    Returns: {9, 26 }

  11. 40

    Returns: {4, 36 }

  12. 90

    Returns: {4, 86 }

  13. 155

    Returns: {9, 146 }

  14. 250

    Returns: {4, 246 }

  15. 573

    Returns: {9, 564 }

  16. 947

    Returns: {9, 938 }

  17. 1532

    Returns: {4, 1528 }

  18. 1991

    Returns: {9, 1982 }

  19. 1992

    Returns: {4, 1988 }

  20. 1993

    Returns: {9, 1984 }

  21. 1994

    Returns: {4, 1990 }

  22. 1995

    Returns: {9, 1986 }

  23. 1996

    Returns: {4, 1992 }

  24. 1997

    Returns: {9, 1988 }

  25. 1998

    Returns: {4, 1994 }

  26. 1999

    Returns: {9, 1990 }

  27. 2000

    Returns: {4, 1996 }

  28. 1926

    Returns: {4, 1922 }

  29. 1891

    Returns: {9, 1882 }

  30. 1552

    Returns: {4, 1548 }

  31. 120

    Returns: {4, 116 }

  32. 617

    Returns: {9, 608 }

  33. 1945

    Returns: {9, 1936 }

  34. 1323

    Returns: {9, 1314 }

  35. 343

    Returns: {9, 334 }

  36. 1312

    Returns: {4, 1308 }

  37. 728

    Returns: {4, 724 }

  38. 1024

    Returns: {4, 1020 }

  39. 1023

    Returns: {9, 1014 }

  40. 1025

    Returns: {9, 1016 }

  41. 729

    Returns: {9, 720 }

  42. 1458

    Returns: {4, 1454 }

  43. 1155

    Returns: {9, 1146 }

  44. 45

    Returns: {15, 30 }

  45. 34

    Returns: {4, 30 }

  46. 27

    Returns: {9, 18 }

  47. 23

    Returns: {9, 14 }

  48. 26

    Returns: {4, 22 }

  49. 33

    Returns: {9, 24 }

  50. 29

    Returns: {9, 20 }

  51. 49

    Returns: {9, 40 }

  52. 43

    Returns: {9, 34 }

  53. 46

    Returns: {4, 42 }


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: