• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Nov 22nd, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #include<stdio.h>
2. int main(){
3.     int T,i,opt;
4.     double x,y;
5.     int arT1[50],arT2[50];
6.
7.
8.     scanf("%d",&T);
9.
10. for(i=0;i<T;i++){
11.     scanf("%f",&arT1[i]);
12. }
13. for(i=0;i<T;i++){
14.     scanf("%f",&arT2[i]);
15. }
16. for(i=0;i<T;i++){
17. if ((arT1[i]/2)==0 && arT1[i]>1)
18. {
19.     scanf("%d", &opt);
20. }
21.     switch(opt){
22. case 1:
23.     for (i=0;i<T;i++){
24.             x = (((arT1[i])*3)/2);
25.
26.     if (x == arT1[i])
27.     {
28.         printf("YES");
29.     }
30.     else printf("NO");
31. }
32. break;
33. case 2:
34.     for (i=0;i<T;i++){
35.              y = (arT1[i]-1);
36.
37.     if (y == arT2[i])
38.     {
39.         printf("YES");
40.     }
41.     else printf("NO");
42.     break;
43. }
44.     }
45. }
46.
47. for (i=0;i<T;i++){
48.     if ((arT1[i]/2)==0){
49.         x = (((arT1[i])*3)/2);
50.     }
51.     if (x == arT2[i])
52.     {
53.         printf("YES");
54.     }
55.     else printf("NO");
56. }
57. for (i=0;i<T;i++){
58.     if (arT1[i]>1){
59.         y = (arT1[i]-1);
60.     }
61.     if (y == arT2[i])
62.     {
63.         printf("YES");
64.     }
65.     else printf("NO");
66. }
67.
68.
69.
70. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top