All Tracks Algorithms Graphs Depth First Search Problem

Anushree and the chess trials
Tag(s):

Easy

Problem
Editorial
Analytics

Anushree had to take the trial of chess for selection of InterNIT chess team. But many people were interested to take part in the trials, so she decided to knock out the contestants on their skills of chess. She decided of a problem statement such that you are given a board of n x n dimension,and the position of the horse (x,y) co-ordinate where x is the row no and y is the column no,find the percentage of positions on the n x n board you can cover starting from the given point.Can you solve this problem?

Input:
First line contains the number of testcases t. Next t lines contain 3 numbers, first is size n of the board, second is the value of x, and third is the value of y.

Output:
Output should contain the single number telling the percentage of area upto 2 decimals for each testcase on a new line.

constraints:
1<=t<=100
3<=n<=30
1<=x,y<=n

SAMPLE INPUT
1
8 1 1
SAMPLE OUTPUT
100.00
Time Limit: 0.6 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Visvesvaraya National Institute of Technology,Nagpur

Challenge Name

AXIS'18 - Insomnia:Warmup

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications

?