We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #166: Criss Cross

Project Euler #166: Criss Cross

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 166 from projecteuler.net

A grid is filled with digits .

It can be seen that in the grid

6 3 3 0
5 0 4 3
0 7 1 4
1 2 4 5

the sum of each row and each column has the value . Moreover the sum of each diagonal is also .

In how many ways can you fill a grid with the digits so that each row, each column, and both diagonals have the same sum?

Input Format

One integer is given on first line representing

Constraints

Output Format

Print one integer which is the answer to the problem.

Sample Input 0

1

Sample Output 0

34

Author

Arterm

Difficulty

Easy

Max Score

100

Submitted By

786

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy