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< ; 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