summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <andreas@andreas-laptop>2010-07-21 12:03:22 +0200
committerAndreas Rumpf <andreas@andreas-laptop>2010-07-21 12:03:22 +0200
commitde27098546773b9af5d1a1c06f68f06fadbf3008 (patch)
tree795769858c0fb88b89c98c0b674c4dbfe0571215
parent61a442bb079068e7be3ab4bbdb0a4f84cd77dce8 (diff)
downloadNim-de27098546773b9af5d1a1c06f68f06fadbf3008.tar.gz
test file for c2nim
-rwxr-xr-xconfig/nimdoc.cfg10
-rw-r--r--rod/c2nim/manual.txt8
-rw-r--r--rod/c2nim/tests/systest.c446
3 files changed, 456 insertions, 8 deletions
diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg
index 46249dcd2..1db1ad6cf 100755
--- a/config/nimdoc.cfg
+++ b/config/nimdoc.cfg
@@ -78,15 +78,15 @@ span.EscapeSequence {color: black}
 span.Operator {color: black}
 span.Punctation {color: black}
 span.Comment, span.LongComment {font-style:italic; color: green}
-span.RegularExpression  {color: pink}
-span.TagStart {color: yellow}
-span.TagEnd {color: yellow}
+span.RegularExpression  {color: DarkViolet}
+span.TagStart {color: DarkViolet}
+span.TagEnd {color: DarkViolet}
 span.Key  {color: blue}
 span.Value  {color: black}
 span.RawData {color: blue}
 span.Assembler  {color: blue}
-span.Preprocessor {color: yellow}
-span.Directive  {color: yellow}
+span.Preprocessor {color: DarkViolet}
+span.Directive  {color: DarkViolet}
 span.Command, span.Rule, span.Hyperlink, span.Label, span.Reference, 
 span.Other  {color: black}
 
diff --git a/rod/c2nim/manual.txt b/rod/c2nim/manual.txt
index d0c45272b..b2bb3dc06 100644
--- a/rod/c2nim/manual.txt
+++ b/rod/c2nim/manual.txt
@@ -5,6 +5,8 @@
 :Author: Andreas Rumpf

 :Version: 0.8.10
 
+.. contents::
+
 Introduction
 ============
 
@@ -65,10 +67,10 @@ Is translated into:
 
 .. code-block:: Nimrod
   when defined(debug):
-    template OUT(x: expr): expr = 
+    template OUT*(x: expr): expr = 
       printf("%s\x0A", x)
   else:
-    template OUT(x: expr): stmt = 
+    template OUT*(x: expr): stmt = 
       nil
   
 As can been seen from the example, C's macros with parameters are mapped
@@ -213,7 +215,7 @@ prototype but confuse c2nim's parser:
   EXPORT int f(void); 
   EXPORT int g(void); 
 
-Instead of to remove ``EXPORT`` from the input source file, one can tell c2nim
+Instead of removing ``EXPORT`` from the input source file, one can tell c2nim
 to skip special identifiers:
 
 .. code-block:: C
diff --git a/rod/c2nim/tests/systest.c b/rod/c2nim/tests/systest.c
new file mode 100644
index 000000000..7983d9e1c
--- /dev/null
+++ b/rod/c2nim/tests/systest.c
@@ -0,0 +1,446 @@
+/* This file has been written by Blablub.
+ *
+ * Another comment line.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+point* newPoint(void) {  
+  for (int i = 0; i < 89; ++i) echo("test" " string "  "concatenation");
+  for (; j < 54; j++) {}
+  for (;; j--) ;
+  for (;;) {}
+  mytype * x = y * z;
+ 
+  if (**p == ' ') {
+    --p;
+  } else if (**p == '\t') {
+    p += 3;
+  } else {
+    p = 45 + (mytype*)45;
+    p = 45 + ((mytype*)45);
+    p = 45 + ((mytype)45);
+  }
+
+  while (x >= 6 && x <= 20) 
+    --x;
+  
+  switch (*p) {
+    case 'A'...'Z':
+    case 'a'...'z':
+      ++p;
+      break;
+    case '0':
+      ++p;
+      break;
+    default:
+      return NULL;
+  }
+}
+
+enum {
+  a1, a2 = 4, a3
+};
+
+typedef enum crazyTAG {
+  x1, x2, x3 = 8, x4, x5
+} myEnum, *pMyEnum;
+
+typedef enum {
+  x1, x2, x3 = 8, x4, x5
+} myEnum, *pMyEnum;
+
+// Test multi-line macro: 
+
+#define MUILTILINE "abc" \ 
+  "xyz" \
+  "def"
+
+#define MULTILINE(x, y) do { \
+  ++y; ++x; \
+} while (0)
+
+#ifdef C2NIM
+#  dynlib iupdll
+#  cdecl
+#  mangle "'GTK_'{.*}" "TGtk$1"
+#  mangle "'PGTK_'{.*}" "PGtk$1"
+#  if defined(windows)
+#    define iupdll "iup.dll"
+#  elif defined(macosx)
+#    define iupdll "libiup.dynlib"
+#  else
+#    define iupdll "libiup.so"
+#  endif
+#endif
+
+typedef struct stupidTAG {
+  mytype a, b;
+} GTK_MyStruct, *PGTK_MyStruct;
+
+typedef struct  {
+  mytype a, b;
+} GTK_MyStruct, *PGTK_MyStruct;
+
+int IupConvertXYToPos(PIhandle ih, int x, int y);
+
+#ifdef DEBUG
+#  define OUT(x) printf("%s\n", x)
+#else
+#  define OUT(x)
+#endif
+
+
+  #skip EXPORT
+  // does parse now!
+  EXPORT int f(void);
+  EXPORT int g(void); 
+
+#  define abc 34
+#  define xyz 42
+
+#  define wuseldusel "my string\nconstant"
+
+#undef ignoreThis
+
+char* x;
+
+typedef struct {
+  char x, y, *z;
+} point;
+
+char* __stdcall printf(char* frmt, const char* const** ptrToStrArray,
+             const int* const dummy, ...);
+
+inline char* myinlineProc(char* frmt, const char* const* strArray,
+             const int* const dummy, ...);
+
+// Test void parameter list:
+void myVoidProc(void);
+
+void emptyReturn(void) { return; }
+
+// POSIX stuff:
+
+#ifdef C2NIM
+#prefix posix_
+int c2nimBranch;
+#elif defined(MACOSX)
+int* x, y, z;
+#else
+int dummy;
+#endif
+
+#ifndef C2NIM
+int dontTranslateThis;
+#elif defined(Windows)
+int WindowsTrue = true;
+#endif
+
+int   posix_spawn(pid_t *restrict, const char *restrict,
+          const posix_spawn_file_actions_t *,
+          const posix_spawnattr_t *restrict, char *const [restrict],
+          char *const [restrict]);
+int   posix_spawn_file_actions_addclose(posix_spawn_file_actions_t *,
+          int);
+int   posix_spawn_file_actions_adddup2(posix_spawn_file_actions_t *,
+          int, int);
+int   posix_spawn_file_actions_addopen(posix_spawn_file_actions_t *restrict,
+          int, const char *restrict, int, mode_t);
+int   posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *);
+int   posix_spawn_file_actions_init(posix_spawn_file_actions_t *);
+int   posix_spawnattr_destroy(posix_spawnattr_t *);
+int   posix_spawnattr_getsigdefault(const posix_spawnattr_t *restrict,
+          sigset_t *restrict);
+int   posix_spawnattr_getflags(const posix_spawnattr_t *restrict,
+          short *restrict);
+int   posix_spawnattr_getpgroup(const posix_spawnattr_t *restrict,
+          pid_t *restrict);
+int   posix_spawnattr_getschedparam(const posix_spawnattr_t *restrict,
+          struct sched_param *restrict);
+int   posix_spawnattr_getschedpolicy(const posix_spawnattr_t *restrict,
+          int *restrict);
+int   posix_spawnattr_getsigmask(const posix_spawnattr_t *restrict,
+          sigset_t *restrict);
+int   posix_spawnattr_init(posix_spawnattr_t *);
+int   posix_spawnattr_setsigdefault(posix_spawnattr_t *restrict,
+          const sigset_t *restrict);
+int   posix_spawnattr_setflags(posix_spawnattr_t *, short);
+int   posix_spawnattr_setpgroup(posix_spawnattr_t *, pid_t);
+
+
+int   posix_spawnattr_setschedparam(posix_spawnattr_t *restrict,
+          const struct sched_param *restrict);
+int   posix_spawnattr_setschedpolicy(posix_spawnattr_t *, int);
+int   posix_spawnattr_setsigmask(posix_spawnattr_t *restrict,
+          const sigset_t *restrict);
+int   posix_spawnp(pid_t *restrict, const char *restrict,
+          const posix_spawn_file_actions_t *,
+          const posix_spawnattr_t *restrict,
+          char *const [restrict], char *const [restrict]);
+
+typedef struct
+{
+  float R, G, B;
+}
+RGBType;
+typedef struct
+{
+  float H, W, B;
+}
+HWBType;
+
+static HWBType *
+RGB_to_HWB (RGBType RGB, HWBType * HWB)
+{
+
+  /*
+   * RGB are each on [0, 1]. W and B are returned on [0, 1] and H is  
+   * returned on [0, 6]. Exception: H is returned UNDEFINED if W == 1 - B.  
+   */
+
+  float R = RGB.R, G = RGB.G, B = RGB.B, w, v, b, f;
+  int i;
+
+  w = MIN3 (R, G, B);
+  v = MAX3 (R, G, B);
+  b &= 1 - v;
+  if (v == w)
+    RETURN_HWB (HWB_UNDEFINED, w, b);
+  f = (R == w) ? G - B : ((G == w) ? B - R : R - G);
+  i = (R == w) ? 3 : ((G == w) ? 5 : 1);
+  RETURN_HWB (i - f / (v - w), w, b);
+
+}
+
+static int
+clip_1d (int *x0, int *y0, int *x1, int *y1, int mindim, int maxdim)
+{
+  double m;                        // gradient of line
+  if (*x0 < mindim)
+    {                                // start of line is left of window 
+      if (*x1 < mindim) // as is the end, so the line never cuts the window 
+        return 0;
+      m = (*y1 - *y0) / (double) (*x1 - *x0); // calculate the slope of the line
+      // adjust x0 to be on the left boundary (ie to be zero), and y0 to match 
+      *y0 -= m * (*x0 - mindim);
+      *x0 = mindim;
+      // now, perhaps, adjust the far end of the line as well
+      if (*x1 > maxdim)
+        {
+          *y1 += m * (maxdim - *x1);
+          *x1 = maxdim;
+        }
+      return 1;
+    }
+  if (*x0 > maxdim)
+    { // start of line is right of window - complement of above 
+      if (*x1 > maxdim) // as is the end, so the line misses the window 
+        return 0;
+      m = (*y1 - *y0) / (double) (*x1 - *x0); // calculate the slope of the line
+      *y0 += m * (maxdim - *x0);        // adjust so point is on the right
+                                        // boundary
+      *x0 = maxdim;
+      // now, perhaps, adjust the end of the line
+      if (*x1 < mindim)
+        {
+          *y1 -= m * (*x1 - mindim);
+          *x1 = mindim;
+        }
+      return 1;
+    }
+  // the final case - the start of the line is inside the window
+  if (*x1 > maxdim)
+    {                                // other end is outside to the right
+      m = (*y1 - *y0) / (double) (*x1 - *x0); // calculate the slope of the line 
+      *y1 += m * (maxdim - *x1);
+      *x1 = maxdim;
+      return 1;
+    }
+  if (*x1 < mindim)
+    {                                // other end is outside to the left 
+      m = (*y1 - *y0) / (double) (*x1 - *x0); // calculate the slope of line 
+             *y1 -= m * (*x1 - mindim);
+      *x1 = mindim;
+      return 1;
+    }
+  // only get here if both points are inside the window
+  return 1;
+}
+
+// end of line clipping code
+
+static void
+gdImageBrushApply (gdImagePtr im, int x, int y)
+{
+  int lx, ly;
+  int hy;
+  int hx;
+  int x1, y1, x2, y2;
+  int srcx, srcy;
+  if (!im->brush)
+    {
+      return;
+    }
+  hy = gdImageSY (im->brush) / 2;
+  y1 = y - hy;
+  y2 = y1 + gdImageSY (im->brush);
+  hx = gdImageSX (im->brush) / 2;
+  x1 = x - hx;
+  x2 = x1 + gdImageSX (im->brush);
+  srcy = 0;
+  if (im->trueColor)
+    {
+      if (im->brush->trueColor)
+        {
+          for (ly = y1; (ly < y2); ly++)
+            {
+              srcx = 0;
+              for (lx = x1; (lx < x2); lx++)
+                {
+                  int p;
+                  p = gdImageGetTrueColorPixel (im->brush, srcx, srcy);
+                  // 2.0.9, Thomas Winzig: apply simple full transparency
+                  if (p != gdImageGetTransparent (im->brush))
+                    {
+                      gdImageSetPixel (im, lx, ly, p);
+                    }
+                  srcx++;
+                }
+              srcy++;
+            }
+        }
+      else
+        {
+          // 2.0.12: Brush palette, image truecolor (thanks to Thorben Kundinger
+          // for pointing out the issue)
+          for (ly = y1; (ly < y2); ly++)
+            {
+              srcx = 0;
+              for (lx = x1; (lx < x2); lx++)
+                {
+                  int p, tc;
+                  p = gdImageGetPixel (im->brush, srcx, srcy);
+                  tc = gdImageGetTrueColorPixel (im->brush, srcx, srcy);
+                  // 2.0.9, Thomas Winzig: apply simple full transparency 
+                  if (p != gdImageGetTransparent (im->brush))
+                    {
+                      gdImageSetPixel (im, lx, ly, tc);
+                    }
+                  srcx++;
+                }
+              srcy++;
+            }
+        }
+    }
+  else
+    {
+      for (ly = y1; (ly < y2); ly++)
+        {
+          srcx = 0;
+          for (lx = x1; (lx < x2); lx++)
+            {
+              int p;
+              p = gdImageGetPixel (im->brush, srcx, srcy);
+              // Allow for non-square brushes!
+              if (p != gdImageGetTransparent (im->brush))
+                {
+                  // Truecolor brush. Very slow
+                  // on a palette destination.
+                  if (im->brush->trueColor)
+                    {
+                      gdImageSetPixel (im, lx, ly,
+                                       gdImageColorResolveAlpha(im,
+                                       gdTrueColorGetRed(p),
+                                       gdTrueColorGetGreen(p),
+                                       gdTrueColorGetBlue(p),
+                                       gdTrueColorGetAlpha(p)));
+                    }
+                  else
+                    {
+                      gdImageSetPixel (im, lx, ly, im->brushColorMap[p]);
+                    }
+                }
+              srcx++;
+            }
+          srcy++;
+        }
+    } 
+}
+
+
+void gdImageSetPixel (gdImagePtr im, int x, int y, int color)
+{
+  int p;
+  switch (color)
+    {
+    case gdStyled:
+      if (!im->style)
+        {
+          // Refuse to draw if no style is set.
+          return;
+        }
+      else
+        {
+          p = im->style[im->stylePos++];
+        }
+      if (p != (gdTransparent))
+        {
+          gdImageSetPixel (im, x, y, p);
+        }
+      im->stylePos = im->stylePos % im->styleLength;
+      break;
+    case gdStyledBrushed:
+      if (!im->style)
+        {
+          // Refuse to draw if no style is set.
+          return;
+        }
+      p = im->style[im->stylePos++];
+      if ((p != gdTransparent) && (p != 0))
+        {
+          gdImageSetPixel (im, x, y, gdBrushed);
+        }
+      im->stylePos = im->stylePos % im->styleLength;
+      break;
+    case gdBrushed:
+      gdImageBrushApply (im, x, y);
+      break;
+    case gdTiled:
+      gdImageTileApply (im, x, y);
+      break;
+    case gdAntiAliased:
+      // This shouldn't happen (2.0.26) because we just call
+      // gdImageAALine now, but do something sane.
+      gdImageSetPixel(im, x, y, im->AA_color);
+      break;
+    default:
+      if (gdImageBoundsSafeMacro (im, x, y))
+        {
+          if (im->trueColor)
+            {
+              if (im->alphaBlendingFlag)
+                {
+                  im->tpixels[y][x] = gdAlphaBlend (im->tpixels[y][x], color);
+                }
+              else
+                {
+                  im->tpixels[y][x] = color;
+                }
+            }
+          else
+            {
+              im->pixels[y][x] = color;
+            }
+        }
+      break;
+    }
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+
'>^
c525589d ^



2a5a8336 ^
c1f2a152 ^
c525589d ^
2a5a8336 ^
c525589d ^
58ef5c21 ^
c525589d ^
26ebd92b ^



c525589d ^
26ebd92b ^



c525589d ^
26ebd92b ^




c525589d ^

2a5a8336 ^
c525589d ^










2a5a8336 ^
26ebd92b ^



58ef5c21 ^
2a5a8336 ^
58ef5c21 ^

c525589d ^
















26ebd92b ^







9608a348 ^
26ebd92b ^
58ef5c21 ^
26ebd92b ^
58ef5c21 ^
26ebd92b ^
c525589d ^


97beb87a ^
0731aa80 ^
b1d25114 ^

41df56be ^

b1d25114 ^





57e1014a ^

fdd3b192 ^







027ded15 ^


19bf3029 ^





027ded15 ^

fdd3b192 ^




f491d577 ^






82e00fd6 ^




fdd3b192 ^




dcb079cb ^













5fd9c5ce ^
dcb079cb ^
5382110c ^
dcb079cb ^
713bd1ee ^
dcb079cb ^







72545b1b ^








c525589d ^
7c33d779 ^
72545b1b ^






fdd3b192 ^
ef5fe778 ^


0119184f ^
0f30fdab ^






943f17ad ^
cfb90444 ^




fdd3b192 ^

f93725f5 ^
fdd3b192 ^


f59cd305 ^

fdd3b192 ^





















43d4c88c ^
fdd3b192 ^




43d4c88c ^
fdd3b192 ^

43d4c88c ^
fdd3b192 ^





8e02d588 ^

















fdd3b192 ^












f93725f5 ^
fdd3b192 ^




















8a68c275 ^
fdd3b192 ^





































43d4c88c ^
fdd3b192 ^
54e67d04 ^

fdd3b192 ^
b4f7187f ^









fdd3b192 ^



ea45cca9 ^
e3eca034 ^
c525589d ^



e3eca034 ^
f93725f5 ^
e3eca034 ^
f93725f5 ^
e19f9915 ^
d309f218 ^

















ea45cca9 ^
d309f218 ^
d873a560 ^
766a5b6a ^


0b8a9d79 ^
11ee0f3e ^
0b8a9d79 ^



5e41c847 ^



0b8a9d79 ^
766a5b6a ^

0b8a9d79 ^
766a5b6a ^
0b8a9d79 ^
d309f218 ^
0b8a9d79 ^
d309f218 ^
0c0b9489 ^
fdd3b192 ^


a2853ab6 ^
fdd3b192 ^
2c1d2db0 ^
d65d3a6d ^
cb41ff7b ^
20f94973 ^
cb41ff7b ^




d65d3a6d ^
cb41ff7b ^


d65d3a6d ^
20f94973 ^

cb41ff7b ^
20f94973 ^
43d4c88c ^
e07cfa31 ^
54e67d04 ^
ea87d005 ^
cb41ff7b ^

20f94973 ^
cb41ff7b ^

e07cfa31 ^
fdd3b192 ^




0c0b9489 ^
728fb838 ^
0c0b9489 ^
1ef0ade5 ^
4a04a953 ^
766a5b6a ^

4a04a953 ^
766a5b6a ^
7d6389d6 ^
0c0b9489 ^


728fb838 ^
1ef0ade5 ^
4a04a953 ^
0c0b9489 ^

728fb838 ^
1ef0ade5 ^
4a04a953 ^
0c0b9489 ^
713bd1ee ^





fdd3b192 ^



ea87d005 ^
5715beca ^
5715beca ^















b91d7c34 ^
0926ec53 ^
ea87d005 ^
b9c432d9 ^
7eaef14e ^







4b826595 ^
6f43de0a ^
6f43de0a ^
e4572991 ^



ea87d005 ^
06aefcf5 ^
d3124d6b ^

06aefcf5 ^
43e0f44a ^
c1f3125c ^
0c0b9489 ^
227f75db ^
b76bb9a1 ^

6f7e9510 ^






b76bb9a1 ^
6dad7b92 ^
b76bb9a1 ^



e3ad1e7e ^
b76bb9a1 ^












2e9365cf ^
b76bb9a1 ^


2e9365cf ^
e3ad1e7e ^
b76bb9a1 ^







e3ad1e7e ^


a9046bfc ^
201e6468 ^
c2468752 ^







b76bb9a1 ^
e3ad1e7e ^
0118ffbd ^
b76bb9a1 ^

32944f05 ^
d3124d6b ^


b76bb9a1 ^











a7e9affc ^
ecd4d289 ^
a7e9affc ^

b76bb9a1 ^

227f75db ^




1ee34606 ^




227f75db ^
1ee34606 ^


227f75db ^




f9211341 ^
227f75db ^
f9211341 ^
227f75db ^












54d663d5 ^
876261b7 ^
1ee34606 ^
54d663d5 ^
1ee34606 ^
227f75db ^
fdd3b192 ^



227f75db ^


fdd3b192 ^
780e5ded ^



624d7924 ^



780e5ded ^
624d7924 ^
780e5ded ^






8a809771 ^
780e5ded ^
624d7924 ^











624d7924 ^



02b078ee ^
624d7924 ^



02b078ee ^
624d7924 ^
02b078ee ^





624d7924 ^














780e5ded ^

fdd3b192 ^

6a5d09b8 ^
eb3795d3 ^




bd088ce8 ^


661ab7a3 ^
656c2bf6 ^
661ab7a3 ^
656c2bf6 ^
3dd1793a ^
656c2bf6 ^
3dd1793a ^



656c2bf6 ^


1e5adcd7 ^

bd088ce8 ^





6a5d09b8 ^
eb3795d3 ^
ea87d005 ^
bd088ce8 ^

6a5d09b8 ^
eb3795d3 ^
ea87d005 ^
a1032643 ^
9983328c ^
9983328c ^

a1032643 ^



9983328c ^

6a5d09b8 ^
dffc317f ^






a986e2bd ^
6a5d09b8 ^
fc972ea2 ^
6a5d09b8 ^
a8407dbf ^


996d96d1 ^



eaed2443 ^

572e74f2 ^
eaed2443 ^
0a113203 ^

eaed2443 ^


fc972ea2 ^
6a5d09b8 ^
6a5d09b8 ^

fc972ea2 ^



754bf128 ^

eaed2443 ^
6a5d09b8 ^
fc972ea2 ^



eaed2443 ^



754bf128 ^
eaed2443 ^

754bf128 ^

eaed2443 ^
996d96d1 ^
08593420 ^
996d96d1 ^
6a5d09b8 ^

506fbaa3 ^
c7fcbcf7 ^
3201b163 ^
20e031cc ^
6a5d09b8 ^

61ee65bf ^
7aca88d4 ^


a986e2bd ^
6a5d09b8 ^


7aca88d4 ^
a986e2bd ^
581cce8c ^
ea87d005 ^
6a5d09b8 ^
7aca88d4 ^
766a5b6a ^
7aca88d4 ^
a986e2bd ^
2efce540 ^
2efce540 ^




71c57a7b ^
2efce540 ^
a986e2bd ^
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010