Andrey thinks he is genuinely a fruitful engineer, yet as a general rule he didn't know about the double inquiry calculation up to this point. Subsequent to perusing some writing Andrey comprehended that this calculation permits to rapidly find a specific number x in a cluster.    that the components

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Correct answer will be upvoted else Multiple Downvoted. Don't submit random answer. Computer science.

Andrey thinks he is genuinely a fruitful engineer, yet as a general rule he didn't know about the double inquiry calculation up to this point. Subsequent to perusing some writing Andrey comprehended that this calculation permits to rapidly find a specific number x in a cluster. 

 

that the components of the cluster are listed from nothing, and the division is done in integers (adjusting down). 

 

Andrey read that the calculation possibly works if the cluster is arranged. Notwithstanding, he tracked down this assertion false, in light of the fact that there unquestionably exist unsorted clusters for which the calculation track down x! 

 

Andrey needs to compose a letter to the book writers, yet prior to doing that he should consider the stages of size n to such an extent that the calculation tracks down x in them. A change of size n is an exhibit comprising of n unmistakable integers among 1 and n in subjective request. 

 

Help Andrey and see as the number of changes of size n which contain x at position pos and for which the given execution of the double hunt calculation tracks down x (brings valid back). As the outcome might be amazingly enormous, print the rest of its division by 109+7. 

 

Input 

 

The main line of input contains integers n, x and pos (1≤x≤n≤1000, 0≤pos≤n−1) — the necessary length of the stage, the number to look, and the necessary situation of that number, separately. 

 

Output 

 

Print a solitary number — the rest of the division of the number of legitimate stages by 109+7.

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education