Skip to content

Instantly share code, notes, and snippets.

@Jack-Saleem
Last active July 17, 2016 13:38
Show Gist options
  • Save Jack-Saleem/fa2aac3d7d71443d22f4 to your computer and use it in GitHub Desktop.
Save Jack-Saleem/fa2aac3d7d71443d22f4 to your computer and use it in GitHub Desktop.
codeforces 270A FancyFence program in java
import java.util.Scanner;
public class FancyFence
{
public static void main(String[] args)
{
Scanner z=new Scanner(System.in);
int t=z.nextInt();
int a[]=new int[t];
String aa[]=new String[t];
for(int i=0;i<a.length;i++)
a[i]=z.nextInt();
for(int i=0;i<a.length;i++)
{
int temp=0;
boolean flag=false;
while(temp<=360){
if(temp==360){
flag=true;
break;
}
temp+=180-a[i];
}
if(flag)
aa[i]="YES";
else
aa[i]="NO";
}
for(String xx:aa)
System.out.println(xx);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment