"Construction" Fzu 2140 Forever 0.5

Source: Internet
Author: User

Click to open link

Test instructions: Enter n, which indicates n points,

Requirements:

1. Distance of any two points ≤1.0

2. The distance between each point and the Origin ≤1.0

3. The distance between the N-point =1.0

4.N points form an area of ≥0.5≤0.75


You can first take one vertex as the origin, and the other two are the positive triangles on the unit circle.


The other points are on the arc BC.

Divide BC equally

And the fourth point of the n==4 must be at the midpoint of BC.

#include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <cctype > #include <cmath> #include <string> #include <sstream> #include <iostream> #include < Algorithm> #include <iomanip>using namespace std; #include <queue> #include <stack> #include < vector> #include <deque> #include <set> #include <map>typedef long long ll;typedef long double LD; const double eps=1e-8; #define PI ACOs ( -1.0) #define Lson L, M, Rt<<1#define Rson m+1, R, Rt<<1|1typedef pair&lt ; int, int> pi;typedef pair<int, pi> PP; #ifdef _win32#define lld "%i64d" #else # define LLD "%lld" #endif//#pragma co Mment (linker, "/stack:1024000000,1024000000")//ll Quick (ll A, ll b) {ll ans=1;while (b) {if (b & 1) ans*=a;a=a*a;b> >=1;} return ans;} inline int read () {char ch= "; int ans=0;while (ch< ' 0 ' | | ch> ' 9 ') Ch=getchar (); while (ch<= ' 9 ' && ch>= ' 0 ') {ans=ans*10+ch-' 0 '; Ch=getchar ();} Return ans;} inline void print (LL x) {printf (LLD, x);p UTS (""); inline void read (double &x) {char c = getchar (); while (C < ' 0 ') c = GetChar (), x = C-' 0 '; c = GetChar (); while (c &G t;= ' 0 ') {x = x * + (C-' 0 '); c = GetChar ();}} inline void SC (LL &x) {scanf (LLD, &x);}    int main () {int n,t;    cin>>t;        while (t--) {cin>>n;        if (n<4) printf ("no\n");            else {printf ("yes\n");            printf ("%.6lf%.6lf\n", 0.0,0.0);            printf ("%.6lf%.6lf\n", 1.0,0.0);            printf ("%.6lf%.6lf\n", 0.5,sqrt (3.0)/2.0);            Double St;                for (int i=1;i<=n-3;i++) {st= (pi/3.0/(n-2)) *i;                Double Xx=cos (ST);                Double yy=sqrt (1-XX*XX);            printf ("%.6lf%.6lf\n", xx,yy); }}} return 0;}


"Construction" Fzu 2140 Forever 0.5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.