-
Notifications
You must be signed in to change notification settings - Fork 13
/
MYQ1.cpp
83 lines (57 loc) · 2.9 KB
/
MYQ1.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n;
scanf("%d",&n);
double b=(n-1)/5.0;
int a=(int)ceil(b);
if(a==0)
printf("poor conductor\n");
else
{
if((a%2)==0)
{
long c=5*a;
switch(c-(n-1))
{
case 0: printf("%d W L\n",a);
break;
case 1: printf("%d A L\n",a);
break;
case 2: printf("%d A R\n",a);
break;
case 3: printf("%d M R\n",a);
break;
case 4: printf("%d W R\n",a);
break;
}
}
else if((a%2)==1)
{
long c=5*a;
switch(c-(n-1))
{
case 4: printf("%d W L\n",a);
break;
case 3: printf("%d A L\n",a);
break;
case 2: printf("%d A R\n",a);
break;
case 1: printf("%d M R\n",a);
break;
case 0: printf("%d W R\n",a);
break;
}
}
}
}
system ("pause");
return 0;
}