Statistics

Problem Statement for "TrianglesContainOriginEasy"

Problem Statement

We have chosen a finite set of points in the plane. You are given their coordinates in the int[]s x and y: for each valid i, there is a point with coordinates (x[i],y[i]). We are interested in triangles with the following properties:
  • Each vertex of the triangle is one of our chosen points.
  • The point (0,0) lies inside the triangle.
Return the number of such triangles. Note that the constraints guarantee that there are no degenerate triangles and that the point (0,0) never lies on the boundary of a triangle.

Definition

Class:
TrianglesContainOriginEasy
Method:
count
Parameters:
int[], int[]
Returns:
int
Method signature:
int count(int[] x, int[] y)
(be sure your method is public)

Constraints

  • x and y will contain between 3 and 50 elements, inclusive.
  • x and y will contain the same number of elements.
  • Each element of x and y will be between -1,000 and 1,000, inclusive.
  • No two points will be the same.
  • No three points will be collinear.
  • No point will be on the origin.
  • There will be no two points P and Q such that P, Q, and the origin are collinear.

Examples

  1. {928,991,-307,14,830,681,777,256,775,441,517,56,497,-129,392,108,230,258,820,-271,41,-722,575,694,691,371,734,177,-91,917,256,927,-307,-403,-339,-424,392,706,807,10,899,177,-91,815,895,822,-708,279,992}

    {-800,912,646,855,-879,-810,750,-99,-866,710,465,892,-3,195,202,311,542,-121,-878,954,944,958,775,-754,929,983,417,761,607,-707,625,-72,636,782,521,901,916,-821,580,79,-971,477,1000,725,-685,734,922,739,464}

    Returns: 0

  2. {665,499,-491,357,861,421,770,-83,-696,-759,-730,-423,720,-577,-302,133,918,245,838,33,-249,834,587,658,612,715,309,819,850,861,469,393,118,-400,-455,413,511,518,866,-913,872,-457,112,225,685,-801,736,-396,-840}

    {868,586,491,-145,384,46,344,240,840,665,493,932,-193,997,263,334,843,-137,572,888,352,112,-39,485,20,-174,250,93,47,545,-248,505,674,962,924,-274,19,885,85,914,547,321,165,698,-77,734,68,618,611}

    Returns: 0

  3. {423,952,615,-694,-400,7,628,-314,581,448,-356,808,844,-429,828,-791,227,495,513,925,12,-498,-520,-331,643,-982,491,-74,426,756,607,652,786,668,-417,-900,-223,913,607,-61,-694,-206,511,-45,655,989,-172,546,-15}

    {0,-612,-97,719,502,594,699,324,-101,681,752,-102,714,302,61,641,886,323,64,-1,876,872,714,851,371,886,747,580,814,808,501,503,-38,657,555,719,295,-359,-12,464,966,300,103,333,534,936,139,584,985}

    Returns: 0

  4. {-396,196,-833,-49,-846,-527,-675,-78,-625,-465,-832,-682,-335,-969,-774,-380,-154,-518,-245,-551,-403,-306,-818,-465,-907,-38,-956,-410,-676,-519,-792,-249,-575,-437,-207,-668,-99,-596,-704,-190,-298,-697,-771,-738,196,-756,-351,-446,-482}

    {-211,-656,-853,-59,-660,-504,470,147,-703,612,-572,-907,-750,-773,321,13,-288,153,-324,754,703,-264,429,-666,671,-875,148,156,966,86,-613,658,887,-543,375,-224,209,-384,-624,423,-269,409,685,-654,-811,996,-910,360,811}

    Returns: 0

  5. {-495,729,-30,920,-584,-228,-175,985,-82,665,673,661,33,844,-372,-511,795,818,173,944,572,-72,633,12,-219,886,-307,816,317,-99,187,204,-657,732,450,567,549,-682,740,-964,619,713,-35,950,669,-383,55,991,-118}

    {-640,375,-561,-837,-534,-676,-823,-368,-996,171,-783,-340,15,-269,-243,-456,-618,-723,-702,-751,-343,-99,-100,-81,-587,485,-897,-384,-164,-167,-349,-215,-982,-777,49,-595,-529,-706,-488,-986,-834,-298,-648,362,-521,-935,-557,180,-240}

    Returns: 0

  6. {-448,-564,-419,-865,-977,-27,-735,-266,-360,-672,-476,-859,-642,-393,-784,-724,594,-266,-317,172,589,-203,683,-809,-728,-246,-421,-809,-882,-688,-279,332,-875,-842,-283,-892,-889,69,-629,-893,-448,32,-373,-643,-6,-376,64,-760,-935}

    {468,440,-563,-279,-732,-241,-537,91,120,-343,-528,164,-128,475,-98,-386,-835,-903,226,-553,-943,-492,-990,-790,118,149,-283,921,-935,-68,-154,-772,197,386,-83,-478,-640,-188,539,-233,581,-975,-634,102,-460,-357,-252,635,-298}

    Returns: 0

  7. {-980,-56,-918,151,-605,-820,-678,-106,-561,-145,5,-690,-279,127,-666,-495,-131,-357,-981,-289,-846,-565,-93,-767,315,921,-658,-757,324,-836,-787,-931,-946,223,682,-528,638,-369,-828,-993,-939,-813,-419,-209,36,652,-784,-839,-505}

    {298,537,-621,732,111,22,13,967,168,885,38,192,692,815,415,69,85,-255,518,-178,634,-451,154,82,617,921,633,640,874,-160,486,216,-361,272,713,953,891,832,466,-427,-870,-440,700,671,460,1000,889,-420,-141}

    Returns: 0

  8. {-462,-879,-129,-898,-944,-539,-464,-376,-563,-143,-728,-338,-444,43,-524,16,-56,-334,-837,-406,-222,-435,-333,-511,-895,-338,-986,-25,-268,-577,-430,-412,-391,-733,-558,-746,-120,-354,-310,-867,-971,-803,-194,-814,-199,-549,-261,-276,-567}

    {53,911,-93,850,-53,-221,-853,993,482,468,-724,-721,-310,-348,-543,-847,425,-86,8,104,788,831,787,-580,-85,742,-211,-359,44,87,275,427,901,-197,-95,707,-40,464,290,24,739,-545,811,-716,-835,-922,-874,480,-733}

    Returns: 0

  9. {294,-531,851,163,299,755,-566,692,-625,-359,-176,910,-967,564,-979,-632,-82,-56,860,946,-644,-955,295,40,411,-905,-250,-648,-886,177,632,694,-768,-102,936,-781,511,131,581,-86,-576,-443,220,393,755,-625,-600,70,319}

    {957,147,850,248,447,955,134,344,246,700,31,701,531,562,-113,953,991,628,799,729,563,-25,526,639,289,893,249,533,-147,992,599,204,-119,330,583,-103,788,967,959,527,-109,-58,885,951,745,737,9,268,761}

    Returns: 0

  10. {81,106,-12,102,13,754,324,961,544,607,941,793,362,453,95,790,400,184,458,411,807,633,85,76,362,116,134,839,926,340,515,971,576,600,80,679,911,254,382,595,863,633,398,845,984,486,116,869,56}

    {781,440,131,18,577,-988,-656,-455,-187,703,-377,632,83,-670,370,-377,472,-826,427,-952,-917,519,-616,559,-671,664,458,-632,29,528,-46,227,409,956,525,-544,215,346,397,-936,801,-641,-586,-631,-792,-428,-920,-152,-374}

    Returns: 0

  11. {68,-126,-128,-110,-85,-77,-149,-119,-143,-86,-73,-129,52,50,134,-122,-106,-128,-64,-57,-54,94,137,-105,107,81,144,-66,-59,-97,-105,-141,81,-136,136,-78,-67,-97,-72,-120,-116,-115,98,94,-66,-83,90,-113,113}

    {48,121,112,-66,-71,-62,52,104,-106,66,91,-81,29,12,26,-111,93,-75,133,101,-51,39,-17,104,30,-49,-7,-129,-130,69,75,-75,10,143,-49,-125,-144,65,-71,66,108,-84,-8,-33,80,-127,-25,-51,50}

    Returns: 4444

  12. {-52,-139,-65,-128,-96,139,-131,100,76,59,-103,-64,-140,66,-81,-110,80,-93,-75,78,-138,147,-136,140,110,-76,142,142,-97,119,-113,-110,-68,-77,129,-68,-87,-121,103,-102,132,-138,102,-148,55,-93,-78,-112,-139}

    {-86,-144,-55,108,-150,-10,-51,-30,9,-15,-104,-54,-50,-29,112,130,40,93,114,22,-110,-41,-67,-11,-34,-78,-39,-19,-94,42,-145,127,-61,-81,-50,-95,-86,61,30,129,-18,116,17,-61,-30,136,122,-120,131}

    Returns: 4193

  13. {-144,-114,105,-113,-94,-128,-128,75,-135,57,82,105,147,-119,127,74,-85,-83,-75,-53,123,-54,-77,89,55,-70,-105,108,88,-131,-146,75,-62,51,-71,118,-113,-97,-139,-142,-98,-131,-86,133,-127,-111,-146,-77,-75}

    {121,129,-23,-74,-138,-88,51,-32,60,-30,-20,-26,28,145,26,-10,113,-139,147,70,-49,83,-70,-3,37,67,149,38,-35,141,-114,-33,-65,-36,-101,3,57,123,-149,113,-53,-103,-51,30,103,145,-113,100,146}

    Returns: 4360

  14. {-52,99,78,96,-102,147,-128,133,-89,92,130,118,-114,-129,83,-120,-108,-50,-52,-117,-113,128,122,150,-108,-131,-69,-118,129,-89,-81,-99,99,150,-123,-56,63,-73,85,-137,-53,94,-83,-93,-59,121,-69,-62,-110}

    {144,-42,-49,-29,71,23,92,-32,54,-33,48,32,117,-95,-12,73,-50,-119,-85,50,-140,-39,-25,0,-55,-107,51,-133,-7,-74,-63,88,8,18,121,51,-17,92,-19,147,-62,-46,125,91,122,49,106,-70,-110}

    Returns: 4275

  15. {-108,-92,-81,-63,94,-56,-138,-131,-79,-125,92,-148,112,73,129,82,86,-119,-108,70,-109,84,-145,67,-98,127,92,-68,-142,-122,119,-60,71,-150,73,-77,-51,-140,-67,-73,-97,144,55,-111,-127,-128,-138,-61,-124}

    {-124,135,145,62,-49,109,-104,-144,50,-112,8,-97,-10,39,-1,4,17,110,-84,34,-64,-4,68,31,-147,-38,17,60,-104,147,20,-82,-4,-147,-22,58,-114,-112,97,134,86,7,8,-146,95,-119,109,107,-76}

    Returns: 4367

  16. {973,952,905,992,901,974,-936,964,-970,-992,-967,948,904,-937,937,942,917,923,990,-934,956,-952,956,-973,917,945,984,957,-981,-969,915,962,946,942,-987,-972,-920,-966,-989,-994,-986,-958,940,-960,958,-997,-933,936,970}

    {-927,-977,998,927,1000,963,-977,-985,969,-944,946,915,916,-996,-920,-976,-980,991,975,-917,-988,994,-901,972,-969,-963,942,942,-901,930,-964,-912,-962,965,-970,986,-986,927,949,-927,-953,985,-966,-945,915,-967,906,-982,-952}

    Returns: 4771

  17. {907,-965,902,991,-902,-906,917,901,913,931,-962,-914,933,998,-992,-949,-919,-988,983,996,-932,962,-907,-993,-992,-964,934,-983,964,914,-995,-985,-1000,966,-929,908,-941,976,-968,945,925,976,957,919,-903,-921,-991,-936,-988}

    {989,948,-930,-915,949,996,-993,-965,-967,-958,-953,-900,-970,975,-953,987,970,981,-963,994,970,-961,-975,956,-909,-951,-911,-934,-922,-952,921,943,918,904,-902,-948,966,-928,981,-938,996,-906,-905,-948,921,-957,950,916,-932}

    Returns: 4710

  18. {299,-61,336,-465,633,669,109,-727,757,-530,567,227,-371,940,288,343,582,867,821,-785,515,-377,295,-849,-900,-789,-191,725,744,339,-228,804,-343,-647,488,-928,-218,410,588,309,559,892,-13,33,-278,-455,-284,669,558}

    {-173,-252,767,-324,729,590,-312,-227,319,586,721,956,-386,181,-567,384,127,698,-536,443,-720,-18,-969,800,643,-802,289,-266,473,445,5,404,758,-983,648,-416,-711,786,-377,-62,674,-892,940,799,10,-393,83,-283,455}

    Returns: 4652

  19. {596,-257,-207,772,-505,-503,516,-426,-960,-281,219,-849,465,-669,352,-469,-700,728,268,736,-310,-989,-538,978,51,244,-466,-438,125,-950,968,-689,528,950,-872,-528,-44,321,-713,860,-272,420,587,160,57,-118,-386,600,999}

    {-834,-84,-900,262,935,439,550,145,429,-835,-778,-772,609,37,308,-781,545,717,259,-753,973,-434,680,-256,786,992,-884,725,-288,34,-47,659,-328,794,546,-715,-357,828,-123,417,840,-381,653,-29,547,797,655,-161,-185}

    Returns: 4655

  20. {222,983,-876,612,712,331,244,-167,-509,-372,310,167,-203,-945,553,-508,-416,-38,323,-578,655,508,468,794,-937,-684,25,-63,-488,449,-169,-127,285,950,908,845,403,-302,-71,117,601,536,579,26,-212,-524,-741,349,-758}

    {-268,497,-852,-45,-464,-737,301,-638,864,-202,-296,575,-704,-307,-747,250,-998,642,-893,-793,918,375,499,-53,530,876,-651,571,-640,545,-239,-911,749,218,519,324,-59,107,833,921,106,-591,821,-53,609,896,-36,-721,-867}

    Returns: 4719

  21. {-205,696,-372,-30,-369,117,165,-307,-490,254,338,-116,994,-365,605,-656,375,834,-405,-854,-316,559,991,-182,-713,-94,196,191,836,-543,43,484,-336,-883,-162,863,-155,-878,558,965,-335,305,114,-825,-659,805,886,-144,-12}

    {-210,806,258,413,-927,-511,40,20,-839,-849,-63,798,-353,-853,663,185,967,-79,-40,-999,641,551,294,590,-25,824,-738,251,284,466,873,272,-351,104,991,-859,-701,-143,603,-265,-378,945,-153,-713,385,185,775,609,768}

    Returns: 4695

  22. {792,-251,7,409,-744,-901,-129,-574,-839,-474,-107,603,441,687,-814,-725,-88,320,648,-261,-192,-102,410,356,234,-219,579,-709,208,-301,-627,184,901,458,3,63,-527,-851,-832,266,-601,-284,-796,-457,-857,-245,-768,-982,-885}

    {-983,-773,-88,810,217,-46,252,739,-556,-285,-40,-226,116,-816,997,739,48,-966,-459,327,-916,-853,-793,655,-85,287,-712,-741,435,614,-287,-264,607,-442,279,-422,-853,865,-367,-450,-91,391,282,88,200,-627,131,-311,191}

    Returns: 4067

  23. {-882,126,-408,-828,-205,-438,-511,978,986,-592,-658,-645,-434,-765,-178,571,460,426,-308,-160,-890,-270,496,597,-830,366,-53,-419,24,-321,640,-502,137,-60,593,-979,-848,-940,550,-19,-634,-939,585,-829,557,706,612,-263,-591}

    {619,249,816,917,-454,705,660,602,110,-231,-977,-965,797,-6,465,787,663,317,889,701,62,861,108,-799,-474,36,259,-605,348,965,142,919,695,-471,502,-987,-652,-896,-893,107,-246,174,-810,-879,406,631,511,575,915}

    Returns: 4088

  24. {-88,886,-869,54,-838,-946,-378,882,636,352,-515,988,966,-591,649,-94,-567,400,6,-5,46,666,15,-560,618,507,37,-343,-247,59,-38,-347,149,416,-227,-677,304,341,-476,-357,824,-362,-156,837,-671,-106,646,942,-40}

    {-922,952,809,634,212,813,649,199,-433,560,-822,162,-424,415,-751,634,407,-519,-443,-60,-262,-726,328,-160,583,214,108,240,591,635,76,218,768,235,848,-329,-979,713,473,-996,-329,-418,917,-504,172,-313,-119,6,873}

    Returns: 4590

  25. {-413,319,-400,635,-13,-850,330,684,-300,236,-958,-870,-752,-639,-213,602,-317,984,-628,783,497,636,-659,236,-385,-638,-419,-783,523,218,-590,90,713,-448,672,-907,-515,848,826,-139,609,779,36,407,23,-260,-771,922,-966}

    {388,655,456,-964,857,615,113,-413,-606,116,-974,737,-32,653,-167,440,-682,731,-566,97,45,-218,-852,109,122,808,-617,-288,-276,756,-924,570,-58,-998,-612,607,-602,125,267,-149,532,974,686,594,-438,805,-546,313,-684}

    Returns: 4760

  26. {-696,977,631,650,373,675,-432,-358,-408,982,808,-288,749,-862,918,27,-59,-348,234,695,-944,-633,-547,-565,343,151,-67,675,418,-504,220,-949,-798,-362,-662,-517,228,-599,-866,671,987,657,-807,-935,-392,984,-437,-414,-127}

    {785,863,400,837,-7,-918,-920,-897,539,-831,-657,878,-638,919,132,-195,130,-474,-460,994,-519,329,161,381,-11,-168,505,505,389,-997,-795,-804,-499,25,-65,886,-613,483,-626,-381,76,111,330,-88,598,-133,103,-297,420}

    Returns: 4847

  27. {-366,-682,-615,-823,629,-434,868,-771,-870,-286,987,-521,-917,-880,980,884,327,-154,-638,-211,750,-840,214,-652,-476,701,957,-776,798,109,531,445,-450,828,-77,-993,872,-937,-893,27,-141,-926,-749,559,-621,-522,-883,-41,-816}

    {635,-666,-371,-506,942,250,154,-482,-9,260,-2,-813,-808,-453,858,422,729,-821,751,63,-19,689,-395,-429,-420,-389,760,-564,-136,-488,995,596,-880,-859,-383,687,-210,-963,788,125,-38,173,675,-621,238,44,935,-244,-456}

    Returns: 4427

  28. {920,870,363,-870,852,-755,916,-241,908,483,-923,486,428,424,505,-771,919,862,904,-324,-913,912,-886,563,-916,-761,501,-790,362,-707,-265,-960,-269,882,330,-311,-711,396,885,493,907,359,565,551,-761,-797,375,-941,845}

    {593,515,728,788,532,362,574,57,518,-417,749,-389,794,778,-430,383,568,562,563,54,796,577,724,-369,757,342,-382,296,757,318,48,763,71,598,742,48,356,753,517,-430,522,726,-431,-424,326,368,785,700,514}

    Returns: 3209

  29. {-380,130,-461,-185,-205,909,584,-163,-228,599,-669,-666,883,-714,116,616,892,-728,913,-242,609,-416,-157,-221,123,609,620,905,-687,586,-254,128,-706,837,88,848,-254,-237,918,-185,909,-729,-184,919,74,-427,86,-191,-157}

    {-571,572,-510,438,441,129,-975,418,416,-893,-867,-910,218,-863,580,-938,150,-897,132,384,-965,-478,451,460,552,-878,-943,135,-873,-891,426,531,-843,199,533,198,401,469,136,411,170,-847,386,189,582,-514,563,444,435}

    Returns: 3998

  30. {-688,-318,628,617,-764,631,-922,-321,-922,628,-555,-767,-326,8,58,680,-578,629,0,696,651,48,-276,-578,-346,-911,-895,-568,-739,45,-674,-520,-602,-284,-571,616,-545,-926,-687,-20,-17,-338,-951,-931,-557,-956,43,-21,-301}

    {-486,-462,709,659,-463,672,420,-389,454,672,280,-518,-439,558,551,735,255,748,519,665,659,574,-406,301,-400,477,449,271,-473,563,-527,300,297,-409,252,717,345,413,-441,579,575,-430,464,490,263,415,579,490,-419}

    Returns: 2268

  31. {-566,-469,-243,-453,-293,559,-439,-412,-321,-279,-299,-413,-265,-131,-237,-159,-436,-458,-126,-146,-123,-248,-298,-537,-159,-131,-402,-388,-209,-192,-547,-231,-123,-82,-614,552,537,-242,-187,-235,-456,-194,-259,-277,-547,-244,-112,-283,-117}

    {-588,532,618,528,33,515,543,529,49,621,95,516,603,611,644,620,515,468,648,648,643,96,69,-677,622,652,500,518,619,574,-642,69,597,655,-653,488,502,32,616,640,503,660,636,70,-601,632,649,635,687}

    Returns: 615

  32. {-393,-357,-212,-187,-152,-393,331,-176,-367,265,-376,-442,-304,-328,-186,290,-214,-211,321,-201,-272,-254,311,-330,-178,-198,-380,-173,-208,-177,320,-361,-365,298,-347,-250,-429,-237,-185,-250,-217,-219,-216,-298,-172,-144,-389,-390,-426}

    {733,470,139,139,693,464,130,49,776,136,778,481,774,767,13,127,101,87,122,95,55,34,140,755,145,149,511,10,3,173,119,771,720,167,684,77,491,116,37,112,658,698,171,755,724,643,781,509,470}

    Returns: 0

  33. {-86,-830,181,735,-774,-851,-599,-811,676,-31,-822,-620,752,-617,-609,738,-772,124,-681,-851,149,-657,-86,740,-227,677,-105,-591,-94,-781,-88,671,-800,-797,-15,-222,673,-855,-236,-836,-33,-863,-656,-20,161,-780,697,710,-785}

    {297,818,-730,-512,889,809,388,846,-522,300,809,430,-551,464,391,-574,822,-733,424,891,-800,474,303,-537,-354,-539,392,418,358,832,366,-521,855,805,341,-393,-574,837,-343,806,353,808,454,374,-759,865,-590,-569,879}

    Returns: 3938

  34. {-756,288,272,752,-766,251,-548,-759,-801,-10,732,24,65,-576,-51,272,46,-544,814,-518,-31,286,-794,-760,-613,-595,792,-613,-14,225,814,-551,269,115,113,289,291,-781,768,84,748,775,261,-787,-576,279,-816,83,-744}

    {-304,-697,-617,-161,-229,-667,734,-277,-221,-703,-151,295,345,653,-781,-643,358,666,-151,742,-744,-664,-299,-281,645,658,-239,646,-700,-689,-204,745,-653,375,326,-630,-672,-284,-198,380,-161,-164,-638,-239,704,-646,-305,380,-219}

    Returns: 4355

  35. {-214,935,-54,-697,-265,-170,371,368,-214,-657,355,-58,-58,-165,-238,923,-672,-47,977,-179,-243,-101,-178,-96,-655,-664,378,-633,-109,-219,-227,-231,-685,-119,-249,975,-696,385,931,-148,-79,-635,-118,395,-215,-199,-96,383,-6}

    {-460,859,-379,864,-459,-502,126,156,-434,790,111,-440,-430,-418,-495,815,831,-473,811,-325,-451,-390,-473,-432,868,801,123,848,-331,-411,-424,-441,801,-409,-413,872,784,76,807,-370,-395,836,-349,77,-423,-474,-442,77,-407}

    Returns: 3024

  36. {576,195,243,231,677,294,11,253,10,-13,710,659,578,628,-1,733,773,257,710,698,633,597,699,683,696,756,-24,192,595,770,17,271,-45,-59,271,720,770,724,250,653,235,680,233,256,-40,696,684,250,688}

    {437,-427,-376,-455,-540,-801,-351,-435,-269,-268,-565,873,528,477,-269,-587,-537,-362,-567,-547,528,441,848,-589,-585,-584,-313,-459,463,-592,-283,-756,-342,-289,-755,-567,-506,-534,-389,828,-715,-588,-367,-756,-288,-559,923,-421,913}

    Returns: 0

  37. {-171,109,-790,-118,-102,41,-185,-239,-854,576,170,-782,-801,-849,59,570,654,21,67,100,90,55,-788,-835,658,-805,-781,569,-799,-224,-130,155,-867,60,166,-210,-209,628,-201,-160,572,89,31,-212,-789,-176,-849,-179,573}

    {671,-372,-883,648,649,-345,661,341,-861,-381,871,-883,-841,-894,-380,-413,-464,-374,-320,895,-340,-379,-867,-855,-458,-891,-817,-457,-841,326,664,880,-842,-312,893,341,340,-469,320,394,-416,822,-325,296,-812,344,-863,625,-443}

    Returns: 4432

  38. {-1,-1,1}

    {1,-1,0}

    Returns: 1

    There is exactly one possible triangle. It does contain the origin.

  39. {-1,-1,1,2}

    {1,-1,2,-1}

    Returns: 2

    There are four possible triangles. Two of them contain the origin. One is the triangle with vertices in (-1,1), (-1,-1), and (2,-1). The other is the triangle with vertices in (-1,-1), (1,2), and (2,-1).

  40. {-1,-2,3,3,2,1}

    {-2,-1,1,2,3,3}

    Returns: 8

  41. {1,5,10,5,-5,7,-9,-6,-3,0,8,8,1,-4,7,-3,10,9,-6}

    {5,-6,-3,4,-2,-8,-7,2,7,4,2,0,-4,-8,7,5,-5,-2,-9}

    Returns: 256

  42. {489,234,235,-328,-401,508,511,194,-329,-691,509,253,511,-411,496,486,204,-328,-319,-387,234,508,487,485,253,192,-310,235,-398,-700,-318,-317,194,192,-411,-400,-686,-412,-393,-715,-310,-715,-693,-403,-393,-685,-390,-405,-322}

    {605,-60,-72,-295,-903,600,589,-808,-313,-494,590,-63,614,-898,615,605,-809,-313,-299,-904,-71,595,598,593,-44,-806,-305,-58,-908,-510,-316,-296,-814,-795,-896,-893,-502,-901,-904,-513,-307,-509,-503,-901,-889,-489,-907,-889,-317}

    Returns: 3680

  43. {193,191,-406,-107,-710,-220,-406,-107,-394,-397,-688,491,-230,-100,-698,-392,-120,200,196,-103,-391,-712,200,-692,-707,-236,206,-119,-106,-706,213,186,500,-213,-705,201,-116,-388,-399,-104,-704,503,205,-410,-709,-220,-113,-122,206}

    {-814,-810,-913,-458,-494,-49,-904,-433,-885,-899,-491,592,-28,-450,-508,-888,-440,-811,-791,-444,-898,-487,-814,-513,-510,-48,-813,-433,-443,-511,-805,-798,590,-45,-510,-808,-436,-909,-900,-439,-500,613,-803,-886,-490,-54,-438,-435,-800}

    Returns: 1395

  44. {203,191,205,187,493,-413,492,281,262,185,-402,285,-407,258,195,500,178,509,-413,495,-690,493,197,215,179,-710,-711,485,279,-386,-406,189,277,186,259,-390,-705,509,-690,-391,-407,210,193,261,210,495,187,213,-402}

    {-808,204,198,211,593,-894,597,-10,-14,204,-889,-17,-898,8,202,612,201,606,-896,603,-506,586,215,-805,189,-509,-493,611,8,-891,-902,187,-6,189,0,-913,-504,602,-485,-896,-904,-792,-788,5,-809,613,-808,-791,-911}

    Returns: 2375

  45. {-392,-181,-399,-385,-313,-202,-389,-291,211,-312,-210,203,-311,502,191,-307,-296,-412,-395,-385,502,-303,-304,-184,498,-687,-299,197,-401,-298,497,-689,214,507,191,-203,-292,-313,-688,-706,-690,-412,-713,192,-286,-685,-184,-288,-400}

    {-891,451,-899,-892,24,455,-887,32,-789,19,456,-813,34,607,-808,33,32,-911,-898,-907,598,12,29,457,598,-499,17,-796,-898,41,587,-506,-792,588,-805,439,30,13,-486,-490,-514,-902,-504,-799,17,-500,445,33,-902}

    Returns: 2295

  46. {297,205,298,-705,30,198,485,-415,-406,25,-388,-693,18,493,315,2,322,300,201,-705,-697,-414,312,502,-393,20,196,205,320,210,-699,23,-392,2,-692,500,-701,208,7,486,-399,24,-690,-692,189,-408,-413,186,316}

    {-114,-797,-122,-488,-35,-798,606,-915,-905,-31,-891,-490,-22,591,-137,-24,-139,-135,-811,-501,-505,-887,-130,597,-909,-13,-792,-789,-125,-808,-497,-25,-885,-28,-514,614,-485,-803,-13,614,-908,-31,-489,-496,-808,-910,-901,-806,-139}

    Returns: 1575

  47. {1, 5, 10, 5, -5, 7, -9, -6, -3, 0, 8, 8, 1, -4, 7, -3, 10, 9, -6 }

    {5, -6, -3, 4, -2, -8, -7, 2, 7, 4, 2, 0, -4, -8, 7, 5, -5, -2, -9 }

    Returns: 256

  48. {1, -2, -2 }

    {2, -1, 2 }

    Returns: 0

  49. {-1, -1, 1 }

    {1, -1, 0 }

    Returns: 1

  50. {-999, -999, 999 }

    {999, -999, 0 }

    Returns: 1

  51. {-1000, 999, 1000 }

    {-1000, 1000, 999 }

    Returns: 1


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: