Untitled

mail@pastecode.io avatar
unknown
plain_text
25 days ago
686 B
0
Indexable
Never
#define ll long long
#define pb push_back
#define ipar(arr, n) vector<ll> arr(n); for(int i=0;i<n;i++) cin>>arr[i];
#include <cmath>
#include <bits/stdc++.h>
#include <numeric>
using namespace std;

void solve(){
    ll n;
    cin>>n;
    ipar(arr,n); //sorted order
    ll smallestAngle=INT_MAX;
    //ll smallestAngle=arr[1]-arr[0];
    for(int i=1;i<n;i++){
        smallestAngle=min(smallestAngle,arr[i]-arr[i-1]);
    }
    
    smallestAngle=min(smallestAngle,360-(arr[n-1]-arr[0]));
    
    ll cuts=360/(smallestAngle);
    cout<<cuts-arr.size()<<"\n";
}


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t;
	cin>>t;
	while(t--) solve();
}
Leave a Comment