Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

B: Hexagram A Hexagram is a 6 - pointed star, sometimes called the Star of David. Given these numbers: 3 , 1 7 , 1

B: Hexagram
A Hexagram is a 6-pointed star, sometimes called the Star of David. Given these
numbers:
3,17,15,18,11,22,12,23,21,7,9,13
There are four unique ways of assigning the numbers to vertices of the hexagram
such that all of the sets of four numbers along the lines have the same sum (57
in this case). All other ways may be obtained from these by rotation and/or
reflection.
Given is aisunct numvers, in now many ways, uisregarung rotauons anu
reflections, can you assign the numbers to the vertices such that the sum of the
numbers along each of 6 straight lines passing through 4 vertices is the same?
The Input
There will be several test cases in the input. Each test case will consist of twelve
unique positive integers on a single line, with single spaces separating them. All
of the numbers will be less than 1,000,000. The input will end with a line with
twelve 0s.
The Output
For each test case, output the number of ways the numbers can be assigned to
vertices such that the sum along each line of the hexagram is the same. Put
each answer on its own line. Output no extra spaces, and do not separate
answers with blank lines.
Sample Input
Sample Output
4
0
Write in java and use backtracking
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

=+How should it be delivered?

Answered: 1 week ago

Question

=+4 How does one acquire a global mindset?

Answered: 1 week ago