Argus was accused of watching Io, which is anything but a standard cow. Io is a serious pioneer, and she strays rather oftentimes, making Argus' life distressing. So the cowherd chose to build an encased field for Io.    There are n trees developing along the waterway, where Argus tends Io. For this issue, the waterway can be considered to be the OX hub of the Cartesian arrange framework, and the n trees as focuses with the y-

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. Computer science.

Argus was accused of watching Io, which is anything but a standard cow. Io is a serious pioneer, and she strays rather oftentimes, making Argus' life distressing. So the cowherd chose to build an encased field for Io. 

 

There are n trees developing along the waterway, where Argus tends Io. For this issue, the waterway can be considered to be the OX hub of the Cartesian arrange framework, and the n trees as focuses with the y-organize equivalent 0. There is likewise another tree filling in the point (0,1). 

 

Argus will tie a rope around three of the trees, making a three-sided field. Its precise shape doesn't make any difference to Io, yet its region is vital to her. There might be numerous ways for Argus to orchestrate the fence, however just the ones which bring about various spaces of the field are intriguing for Io. Work out the number of various regions that her field might have. Note that the field should have nonzero region. 

 

Input 

 

The input comprises of various experiments. The primary line contains an integer t (1≤t≤100) — the number of experiments. Then, at that point, t experiments follow, every one is depicted in two lines. 

 

In the principal line of each experiment there is a solitary integer n (1≤n≤50) indicating the number of trees developing along the waterway. Next line contains n unmistakable integers x1<x2<… <xn−1<xn (1≤xi≤50), the x-directions of trees developing along the stream. 

 

Output 

 

In a solitary line output an integer, the number of various nonzero regions that triangles with trees as vertices might have

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Types of trees
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