Statistics

Problem Statement for "BiggestRectangleEasy"

Problem Statement

Little Josh has found several sticks that are each 1 inch long. He wants to form a rectangle with the biggest possible area, using these sticks as the perimeter. He is allowed to glue sticks together, but he is not allowed to break a single stick into multiple shorter sticks.

For example, if Josh has 11 sticks, he can create a 2 x 3 rectangle using 10 sticks. This rectangle has an area of 6 square inches, which is the biggest area that can be achieved in this case.

You will be given an int N, and you must return the maximal area (in square inches) of a rectangle that can be created using N or less sticks.

Definition

Class:
BiggestRectangleEasy
Method:
findArea
Parameters:
int
Returns:
int
Method signature:
int findArea(int N)
(be sure your method is public)

Constraints

  • N will be between 4 and 10000, inclusive.

Examples

  1. 11

    Returns: 6

    The example from the problem statement.

  2. 5

    Returns: 1

    The only rectangle that can be created is a square with 1 inch side.

  3. 64

    Returns: 256

    Josh can create a square with the 16 inches side.

  4. 753

    Returns: 35344

  5. 7254

    Returns: 3288782

  6. 4

    Returns: 1

  7. 5

    Returns: 1

  8. 6

    Returns: 2

  9. 7

    Returns: 2

  10. 8

    Returns: 4

  11. 9

    Returns: 4

  12. 10

    Returns: 6

  13. 10000

    Returns: 6250000

  14. 9999

    Returns: 6247500

  15. 9998

    Returns: 6247500

  16. 9997

    Returns: 6245001

  17. 9996

    Returns: 6245001

  18. 9995

    Returns: 6242502

  19. 9524

    Returns: 5669161

  20. 7565

    Returns: 3575881

  21. 9409

    Returns: 5531904

  22. 6380

    Returns: 2544025

  23. 8953

    Returns: 5008644

  24. 4428

    Returns: 1225449

  25. 9407

    Returns: 5529552

  26. 7428

    Returns: 3448449

  27. 6601

    Returns: 2722500

  28. 8982

    Returns: 5042270

  29. 9725

    Returns: 5909761

  30. 5841

    Returns: 2131600

  31. 7585

    Returns: 3594816

  32. 6020

    Returns: 2265025

  33. 3797

    Returns: 900601

  34. 5389

    Returns: 1814409

  35. 9537

    Returns: 5683456

  36. 7182

    Returns: 3223820

  37. 5653

    Returns: 1996569

  38. 1786

    Returns: 199362

  39. 4968

    Returns: 1542564

  40. 7355

    Returns: 3380082

  41. 2508

    Returns: 393129

  42. 2547

    Returns: 405132

  43. 2090

    Returns: 273006

  44. 8395

    Returns: 4403702

  45. 92

    Returns: 529

  46. 2027

    Returns: 256542

  47. 9623

    Returns: 5786430

  48. 1680

    Returns: 176400

  49. 780

    Returns: 38025

  50. 8545

    Returns: 4562496

  51. 5308

    Returns: 1760929

  52. 3471

    Returns: 752556

  53. 7110

    Returns: 3159506

  54. 679

    Returns: 28730

  55. 5495

    Returns: 1886502

  56. 4468

    Returns: 1247689

  57. 3197

    Returns: 638401

  58. 9938

    Returns: 6172740

  59. 8555

    Returns: 4573182

  60. 3021

    Returns: 570025

  61. 9150

    Returns: 5232656

  62. 6681

    Returns: 2788900

  63. 3136

    Returns: 614656

  64. 1435

    Returns: 128522

  65. 3446

    Returns: 742182

  66. 8560

    Returns: 4579600

  67. 386

    Returns: 9312

  68. 4882

    Returns: 1489620

  69. 4

    Returns: 1

  70. 8

    Returns: 4

  71. 111

    Returns: 756

  72. 10

    Returns: 6

  73. 10000

    Returns: 6250000

  74. 14

    Returns: 12

  75. 753

    Returns: 35344


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: