{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n As part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some other item in the same list. You will need a program to help you with the grading. This program should be able to scan the lists and output the correct answer for each one. For example, given the list \n \u003cbr\u003e1 4 3 2 9 7 18 22 \n \u003cbr\u003e \n \u003cbr\u003eyour program should answer 3, as 2 is twice 1, 4 is twice 2, and 18 is twice 9. \n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input file will consist of one or more lists of numbers. There will be one list of numbers per line. Each list will contain from 2 to 15 unique positive integers. No integer will be larger than 99. Each line will be terminated with the integer 0, which is not considered part of the list. A line with the single number -1 will mark the end of the file. The example input below shows 3 separate lists. Some lists may not contain any doubles. \n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"The output will consist of one line per input list, containing a count of the items that are double some other item. \n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e1 4 3 2 9 7 18 22 0\n2 4 8 10 0\n7 5 11 13 1 3 0\n-1 \u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e3\n2\n0\u003c/pre\u003e"}},{"title":"","value":{"format":"HTML","content":"\n#include \u003ciostream\u003e\n#include \u003calgorithm\u003e\n#include \u003ccstring\u003e\nusing namespace std;\nint main()\n{\n\tint i,j,k,a[233]\u003d{0};\n\twhile(cin\u003e\u003ei){\n\t\tif(i\u003d\u003d-1) break;\n\t\ta[i]++;\n\t\tif(i\u003d\u003d0){\n\t\t\t\n\t\t\tk\u003d0;\n\t\t\tfor(j\u003d2;j\u003c\u003d100;j+\u003d2){\n\t\t\t if(a[j/2]\u003e0) k+\u003da[j]; \n\t\t\t } \n\t\t\t cout\u003c\u003ck\u003c\u003cendl;\n\t\t\t memset(a,0,sizeof(a));\n\t\t}\n\t} \n\treturn 0;\n }\n"}}]}